uni-app打包APP报错:[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 
错误

看mpType是否正确,默认是配置:‘app’

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) //全局注册page-head组件,每个页面将可以直接使用该组件
App.mpType = 'app' // 确保mpType

const app = new Vue({
    ...App
})
app.$mount() //挂载Vue实例

使用Vue.use引用插件,使用Vue.prototype添加全局变量,使用Vue.component注册全局组件。

可以引用vuex,因涉及多个文件,此处没有提供示例,详见hello uni-app示例工程。

无法使用vue-router,路由须在pages.json中进行配置。

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

申请证书

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容