READ.md
736 Bytes
正式版appid wx2c28337db96364d2
体验版appid wxc50d04ae5aa9984a
bobodmd a123456(测试)
mingcl4sa a123456(开发)
mdcsx01 a123456(生产)
JXJTMDD1 glsx8888(生产)
computed和watch方法使用
先导入并混合
// 注意: computed 函数中不能访问 this ,只有 data 对象可供访问
// 导入方法
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
// 混入
behaviors: [computedBehavior],
// 使用
computed: {
test(data) {
return data.bgUrl + data.test
}
},
// 默认已深度监听
watch: {
'test, pages': function (a, b) {
console.log(a)
// this.setData({
// sum: a + b,
// })
}
},