嫣旖雲之逸
嫣旖雲之逸
  • 发布:2023-07-09 18:37
  • 更新:2023-07-12 09:01
  • 阅读:690

vite Vue3.0 中 app.config.compilerOptions.isCustomElement 提示错误

分类:uni-app

请问怎么解决??????

错误提示
[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("")
}
}
}
})
],

2023-07-09 18:37 负责人:无 分享
已邀请:
Diligent_UI

Diligent_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

能具体描述问题吗,提供效果截图和代码截图可以高效率解决问题

嫣旖雲之逸

嫣旖雲之逸 (作者)

index.vue:

<wx-open-launch-weapp style="width:100%;" @error="handleErrorFn" id="launch-btn" env-version="release" :appId="appId" :path="path">  
            <script v-is="script" type="text/wxtag-template">  
                <style>  
                    .wx-btn {  
                        display: flex;  
                        justify-content:center;  
                        align-items: center;  
                        width: 120px;  
                        height: 28px;  
                        border: none;  
                        padding: 0 5px;  
                        margin: 0 3px;  
                        border-radius:48px;  
                        /* background: linear-gradient(90deg,rgba(47,128,237,1) 0%,rgba(86,204,242,1) 100%); */  
                        background-color: #09bdfe;  
                        color:#fff;  
                        font-size: 12px;  
                    }  
                    .wx-btn::after {  
                         border: none;  
                     }  
                     .wx-btn::before {  
                         border: none;  
                     }  
                </style>  
                             <button class="wx-btn">打开小程序</button>  
            </script>  

        </wx-open-launch-weapp>

效果:

Diligent_UI

Diligent_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

这是警告而已,不用管

要回复问题请先登录注册