Files
2025-09-14 00:21:54 +08:00

40 lines
824 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Component({
options: {
styleIsolation: 'shared'
},
properties: {
},
data: {
childDataMessage: '',
// 这里是一些组件内部数据
childMessage: '',
someData: {}
},
methods: {
handleClick() {
const com2 = this.selectComponent('#com2');
console.log('com2', com2);
},
handleEventMessage() {
this.setData('childDataMessage', '修改了传给子组件的data');
},
onChildMessage(e) {
this.setData('childMessage', `收到子组件的事件detail${e.detail.data}`);
},
onClear() {
console.log('onClear', this);
this.setData('childMessage', '');
this.setData('childDataMessage', '');
},
handleSelectMessage() {
const com2 = this.selectComponent('#com2');
com2.onTap();
}
},
});