美文网首页
uni-app打包APP报错:[ERROR] : [Vue wa

uni-app打包APP报错:[ERROR] : [Vue wa

作者: QLing09 | 来源:发表于2020-05-26 22:42 被阅读0次
    [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

    申请证书

    相关文章

      网友评论

          本文标题:uni-app打包APP报错:[ERROR] : [Vue wa

          本文链接:https://www.haomeiwen.com/subject/fmvbahtx.html