fast-vue-multi-pages
v1.0.20
Published
快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html
Downloads
9
Readme
fast-vue-multi-pages
快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html,不使用vue单页面功能。
Install
npm i fast-vue-multi-pages
Package.json配置
"dependencies": {
"fast-vue-multi-pages": "^1.0.0", //具体版本以npm库更新为准
}
配置vue.config.js 文件,快速配置VUE项目代码,复制如下代码:
const {FastVueMultiPages} = require("fast-vue-multi-pages/vue");
const result = FastVueMultiPages.getDefaultVueConfig(__dirname, {
projectTitle: "项目标题",
projectPagesDir: ["src/user_pages"],
projectOutDir: "dist",
autoCreateProjectIndexPage: false,
autoCreatePageConfigFile: true,
buildLevel: 1,
httpFinalParams: {
userTest: true,
},
httpBeforeRequest: function (config) {
console.log("httpBeforeRequest", config);
},
httpAfterRequest: function (response) {
console.log("httpAfterRequest", response);
},
globalConfig: {},
injectJsFiles: ["src/js/iconfont.js"],
clientStrict: true
});
module.exports = result;
使用默认工具类
引用库之后,在项目中导入即可,例如:
import {FastVueMultiTool} from "fast-vue-multi-pages";
FastVueMultiTool.Http.get("接口地址", {
orderId: 1
}).then(result => {
if (result.isSuccess()) {
console.error(result.getData());
} else {
console.error(result.getMessage());
}
});