替换 Vue 文件key
的表示,以解决编译报错。
将
:key="'type' + index"
转为
:key="`type-${index}`"
在 vue.config.js
中添加如下设置:
const { LOADER_MAP } = 'plugin-light/lib/loader';
module.export = {
chainWebpack(config) {
config.module
.rule('vue')
.test(/\.vue$/)
.use(LOADER_MAP.replaceVueKey)
.loader(LOADER_MAP.replaceVueKey)
.end();
}
}