const moment = require("moment");
const {qxCloud } = require('../../../api/qxcloud');
const app = getApp();
const computedBehavior = require('miniprogram-computed');
Page({
behaviors: [computedBehavior],
data: {
currentTab: "statistic",
currnet:1,
remedy:{
rows:[],
page:1,
pageSize:10,
total:0,
loadEmpty:false,
isLoading:false
},
errand:{
rows:[],
page:1,
pageSize:10,
total:0,
loadEmpty:false,
isLoading:false
},
vacations:{
rows:[],
page:1,
pageSize:10,
total:0,
loadEmpty:false,
isLoading:false
},
},
watch: {
'remedy.**'(remedy){
console.log(remedy.rows);
let self = this;
if(self.data.currentTab == 'remedy' && self.data.batch_op.doing){
console.log(remedy.rows);
}
},
'vacations.**'(vacations){
console.log(remedy.rows);
let self = this;
if(self.data.currentTab == 'vacation' && self.data.batch_op.doing){
console.log(vacations.rows);
}
},
'errand.**'(errand){
console.log(remedy.rows);
let self = this;
if(self.data.currentTab == 'errand' && self.data.batch_op.doing){
console.log(errand.rows);
}
},
},
}
构建npm了吗
如果你使用的是 4.0 版本以上可以使用以下方法。
新的接口说明详细请查看:https://github.com/wechat-miniprogram/computed
const computedBehavior = require('miniprogram-computed').behavior;