Redoc With VueJS
Aaron Gong

Aaron Gong @aisone

About: Fullstack Developer always improving code to minimize tech debt and obsolescence, maximize agility and scalability

Location:
Singapore
Joined:
Jun 26, 2019

Redoc With VueJS

Publish Date: Feb 21
0 0

Here is a very short post on using Redoc in VueJS.

Below is a component you can use in any VueJS project. Remember to install redoc and null dependencies.

<template>
  <h2>Redoc Sample</h2>
  <div id="redoc-container"></div>
</template>

<script setup>
// npm install redoc
// npm install null
import * as redoc from 'redoc/bundles/redoc.standalone' // requires null package
import { onMounted } from 'vue'

onMounted(() => {
  redoc.init('http://petstore.swagger.io/v2/swagger.json', { "expandResponses": "200,400" }, document.getElementById('redoc-container'))
})
</script>

<style scoped>
</style>
Enter fullscreen mode Exit fullscreen mode

That's all.

Comments 0 total

    Add comment