vue3.0项目webpack/vite配置不解析的自定义元素标签
1. vite
export default defineConfig({
plugins: [vue({
template:{
compilerOptions:{
isCustomElement: tag => tag.startsWith('ion-')
}
}
})],
})
2. webpack
module.exports = function(){
chainWebpack: (config) => {
config.module
.rule("vue")
.use("vue-loader")
.tap((options) => {
options.compilerOptions = {
...options.compilerOptions,
isCustomElement: (tag) => tag.startsWith("ion-"),
};
});
}
🎨 本文大部分内容转载自他人文章,若有问题可点击文章作者查看原文