前因
当前代码构建微信小程序可正常运行,但是无法运行H5,运行起来提示如下错误
chunk-vendors.js:4427 [Vue warn]: Property or method "keepAliveInclude" is not defined on the instance but referenced during render. Make sure that this property is
chunk-vendors.js:4427 [Vue warn]: Error in render: "TypeError: Cannot read property 'meta' of undefined"
刚接触 uniapp,搜了一圈错误信息也没有找到问题所在,于是新建demo组个文件对比发现是 main.js 中我把 App.mpType = 'app' 删除了导致的。
后果
补齐main.js 的 App.mpType = 'app' 即可。
找到原因还是花费了一些时间,故记录一二,以便后者搜索错误提示就可以找到问题~
关于 App.mpType = 'app' 所能找到的说明
小程序页面组件和这个 App.vue 组件的写法和引入方式是一致的,为了区分两者,需要设置mpType值
2 个评论
要回复文章请先登录或注册
turing_lulu
n***@qq.com