init
This commit is contained in:
24
xhs-mini-demos/common/component/example/index.js
Normal file
24
xhs-mini-demos/common/component/example/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
Component({
|
||||
properties: {
|
||||
value: Number
|
||||
},
|
||||
|
||||
data: {
|
||||
value2: ''
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClick() {
|
||||
this.triggerEvent('myevent');
|
||||
}
|
||||
},
|
||||
|
||||
observers: {
|
||||
value: function(value) {
|
||||
// 在 numberA 或者 numberB 被设置时,执行这个函数
|
||||
this.setData({
|
||||
value2: value && '[' + value + ']'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user