@tancou/vue-redoc-wrapper

A Vue.js wrapper component for ReDoc
3,621
Install
npm install @tancou/vue-redoc-wrapper
Latest Version:0.4.0
Vue:3
Older releases:2
License:MIT
Last Updated:Jan 3, 2024
Links: npm
Maintainer: tancou

vue-redoc-wrapper

A Vue.js wrapper component for ReDoc.

npm package

Installation

npm install @tancou/vue-redoc-wrapper --save

Usage

Pass the OpenAPI definitions of your API to the spec-or-spec-url attribute of the component. The attribute value can be given as an object or as a URL to the JSON or YAML file for your API documentation.

<template>
  <div id="app">
    <redoc-wrapper :spec-or-spec-url="'http://petstore.swagger.io/v2/swagger.json'" :options="redocOptions"></redoc-wrapper>
  </div>
</template>

<script>
import RedocWrapper from '@hnluu8/vue-redoc-wrapper'

export default {
  name: 'app',
  components: {
    RedocWrapper
  },
  data() {
    return {
      // https://github.com/Redocly/redoc#redoc-options-object
      redocOptions: {
        hideDownloadButton: false      
      }
    }
  }
}
</script>

Component Props

The component exposes two props: specOrSpecUrl (required) and options (optional). Please visit the documentation for ReDoc's standalone version for more information on their usage.

Demo

vue serve demo/components/SpecUrlExample.vue

Version History

Version Released Vue License
0.4.0 ^3.3.10 MIT
0.3.0 ^3.2.41 MIT
0.2.0 ^2.6.10 MIT