Redoc With VueJS

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. Redoc Sample // 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')) }) That's all.

Feb 21, 2025 - 02:12
 0
Redoc With VueJS

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>
  

Redoc Sample

id="redoc-container">
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>

That's all.