前言:
今天在搭建uni-app项目时,在运行小程序时出现了一些问题。
1.在HbuilderX 运行微信小程序开发者工具出现了没有自动打开小程序,是因为没有打开开发者工具中的设置=>安全设置=>服务端口
2.在运行中出现了Cannot read property ‘forceUpdate’ of undefined
解决方案:
1.首先将项目的manifest.josn文件用编辑器打开,找到小程序特有相关
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
填写appid.之后在运行。
2.如果还报错可能是微信开发者工具的版本比较低,从新升级一下。