uni-app打包APP報(bào)錯(cuò):[ERROR] : [Vue warn]: Failed to mount component: template or render function not d...

[ERROR] : [Vue warn]: Failed to mount component: template or render function not defined.
(found in <Root>) __ERROR 
錯(cuò)誤

看mpType是否正確,默認(rèn)是配置:‘a(chǎn)pp’

app.vue

import Vue from 'vue'
import App from './App'
import pageHead from './components/page-head.vue' //全局引用page-head組件

Vue.config.productionTip = false
Vue.component('page-head', pageHead) //全局注冊(cè)page-head組件,每個(gè)頁(yè)面將可以直接使用該組件
App.mpType = 'app' // 確保mpType

const app = new Vue({
    ...App
})
app.$mount() //掛載Vue實(shí)例

使用Vue.use引用插件,使用Vue.prototype添加全局變量,使用Vue.component注冊(cè)全局組件。

可以引用vuex,因涉及多個(gè)文件,此處沒(méi)有提供示例,詳見(jiàn)hello uni-app示例工程。

無(wú)法使用vue-router,路由須在pages.json中進(jìn)行配置。

https://nativesupport.dcloud.net.cn/AppDocs/usesdk/android

云打包

安卓打包,密鑰生成

keytool -genkey -alias testalias -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore

IOS打包

https://nativesupport.dcloud.net.cn/AppDocs/usesdk/ios

申請(qǐng)證書(shū)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容