l***@outlook.com
l***@outlook.com
  • 发布:2018-12-07 19:34
  • 更新:2018-12-07 20:08
  • 阅读:1534

errorHandler TypeError: Global.on_launch is not a function

分类:uni-app

chrome中报错:errorHandler TypeError: Global.on_launch is not a function

App.vue 中代码:

const Global = require('./config/global');  
    export default {  
        onLaunch: function () {  
            Global.on_launch();  
        },  
        onShow: function () {  
            console.log('App Show');  
        },  
        onHide: function () {  
            console.log('App Hide');  
        }  
    }

global.vue 中代码:

const api = require('./api');  
    export default {  
        on_launch: function() {  

            //每次检查登录状态  
            this.token = wx.getStorageSync('token');  
            this.userInfo = wx.getStorageSync('userInfo');  
            //this.app_signin();  
        }  
}
2018-12-07 19:34 负责人:无 分享
已邀请:
l***@outlook.com

l***@outlook.com (作者)

改成

import Global from '../../config/global' 

就好了,问题关闭谢谢

该问题目前已经被锁定, 无法添加新回复