流程改版
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const app = getApp();
|
||||
|
||||
Component({
|
||||
data: {
|
||||
devices: []
|
||||
},
|
||||
|
||||
// 生命周期方法
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.setData({
|
||||
devices: app.globalData.ppScale.device.list
|
||||
})
|
||||
},
|
||||
detached() {
|
||||
this.setData({
|
||||
devices: []
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 组件的方法
|
||||
methods: {
|
||||
selectDevice(e) {
|
||||
let device = this.data.devices[e.currentTarget.dataset.i];
|
||||
this.triggerEvent('deviceEvent', {
|
||||
device: device,
|
||||
status: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user