1 组件中触发el-form-item校验
export default {
inject: {
elFormItem: {
default: '',
},
},
methods: {
handleChange(val) {
if (this.elFormItem) {
this.elFormItem.$emit('el.form.change', [value]);
}
},
},
}
2 .npmrc文件
registry=https:
@company:registry=https:
3 vue-cli中自定义模板变量
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="<%= BASE_URL %>config.js?<%= TIMESTAMP %>"></script>
</head>
<body>
</body>
</html>
chainWebpack: (config) => {
config.plugin('html').tap(([options]) => {
const defaultTemplateParameters = options.templateParameters;
options.templateParameters = (...args) => ({
...defaultTemplateParameters.apply(options, args),
TIMESTAMP: new Date().getTime(),
});
return [options];
});
}