title | description | position | category | menuTitle | features | ||||
---|---|---|---|---|---|---|---|---|---|
Introduction |
The nuxt-swaggerjsonapi module for Nuxt |
1 |
Introduction |
|
npm install nuxt-swaggerjsonapi
or
yarn add nuxt-swaggerjsonapi
yarn add @nuxtjs/axios
export default {
modules: ["@nuxtjs/axios", "nuxt-swaggerjsonapi"],
plugins: ["~plugins/api"],
};
const path = require("path");
export default {
modules: ["@nuxtjs/axios", "nuxt-swaggerjsonapi"],
plugins: ["~plugins/api"],
swaggerJsonApi: {
// Address generation and local generation
/*
** SourcePath: path.resolve(__dirname, "swagger.json"),
** OR
** FileUrl: "http://localhost:8080/swagger.json",
*/
SourcePath: path.resolve(__dirname, "swagger.json"),
OutputPath: path.resolve(__dirname, "./plugins/api/api.js"),
Model: "details",
},
};
- Sourcepath: Swagger.json route
- OutputPath: Api.js route
// getUserInfo
/*
** Interface name: getUserInfo
** Parameter structure:
** {"name":"AuthToken","in":"header","description":"Token info"}
** methods: The entire API call (Directly copy, paste, remove the notes can be used directly):
GetUserCloudAccount(){
let params = {
}
this.$api.Account.GetUserCloudAccount(params).then(res => {
})
},
** data(Vue use):
GetUserCloudAccountParams: {
}
*/