vas-userinfo是我定义的一个组件,之前小程序上线了,是没有错误的,后来微信版本升级后,就报错了,我把这行代码注释之后就不会报错。(安卓版报同样的错)
<vas-userinfo mode=‘simple’ bindtap=‘toPersonal’></vas-userinfo>
错误如下:
一样会报错呀,连开发者工具都报错了,
代码如下:
properties: {
mode:{
type:String,
value:‘simple’
},
showIndicator:{
type:Boolean,
value:false
}
},
报错信息:
WAService.js:3 jsEnginScriptError
String is not a function
TypeError: String is not a function
at v (http://127.0.0.1:9973/appservice/__dev__/WAService.js:12:14944)
at e.protoFunc.<anonymous> (http://127.0.0.1:9973/appservice/__dev__/WAService.js:12:15439)
at a.doUpdates (http://127.0.0.1:9973/appservice/__dev__/WAService.js:11:28835)
at t.applyProperties (http://127.0.0.1:9973/appservice/__dev__/WAService.js:14:640)
at e.value (http://127.0.0.1:9973/appservice/__dev__/WAService.js:13:26403)
at http://127.0.0.1:9973/appservice/__dev__/WAService.js:13:26475
at Array.forEach (<anonymous>)
at e.value (http://127.0.0.1:9973/appservice/__dev__/WAService.js:13:26447)
at e.value (http://127.0.0.1:9973/appservice/__dev__/WAService.js:13:23357)
at Object.p.create [as createElement] (http://127.0.0.1:9973/appservice/__dev__/WAService.js:12:21061)
// components/vas-userinfo.js
const { profile } = require(’…/…/libs/profile.js’);
Component({
/**
* 组件的属性列表
*/
properties: {
mode: String = ‘simple’, // ‘simple’ or ‘detail’
showIndicator: Boolean = false
},
/**
* 组件的初始数据
*/
data: {
userInfo: {}
},
attached: function() {
if(profile.validate()) {
this.setData({
userInfo: profile.userinfo
})
}
},
/**
* 组件的方法列表
*/
methods: {
}
})