请问怎么解决??????
错误提示:
[Vue warn]: The compilerOptions
config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, compilerOptions
must be passed to @vue/compiler-dom
in the build setup instead.
- For vue-loader: pass it via vue-loader's
compilerOptions
loader option. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom
main.js 配置
app.config.compilerOptions.isCustomElement = (tag) => {
return tag.startsWith('wx-open-launch-weapp')
}
vite.config.js 配置:
plugins: [
uni({
vueOptions: {
template: {
compilerOptions: {
isCustomElement: tag => tag.startsWith("")
}
}
}
})
],