work-form
v0.2.61
Published
Workflow plug in (parser)
Downloads
11
Readme
下载
npm install work-form -S
npm install axios -S
引入
1.在main.js中
import workForm from "work-form";
import axios from "axios";
axios.defaults.withCredentials = true;
Vue.prototype.$axios = axios;
Vue.use(workForm);
2.在index.html中引入
<script
src="https://lib.baomitu.com/vue/2.6.11/vue<%= process.env.NODE_ENV === 'production' ? '.min' : ''%>.js"></script>
配置
在vue.config.js中配置
const minify = process.env.NODE_ENV === 'development' ? false : {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
minifyJS: true
}
module.exports = {
publicPath: "./",
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
minify
},
preview: {
entry: './node_modules/work-form/packagers/workForm/src/main.js',
template: './node_modules/work-form/packagers/workForm/preview.html',
filename: 'preview.html',
chunks: ['chunk-vendors', 'chunk-common', 'preview'],
minify
}
},
lintOnSave: false,
configureWebpack: {
externals: {
vue: 'Vue',
}
},
}