This commit is contained in:
2025-09-14 00:21:54 +08:00
commit d40b3bbd62
766 changed files with 36275 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
.com2-container {
background-color: yellow;
margin: 20px;
height: 250px;
color: black;
}

View File

@@ -0,0 +1,26 @@
Component({
properties: {
message: {
type: String
}
},
data: {
// 这里是一些组件内部数据
someData: {}
},
methods: {
onTap() {
this.triggerEvent('myevent', {
data: '自定义组件内触发triggerEvent'
});
},
onClear() {
console.log('onClear com2', this);
this.triggerEvent('myevent', {
data: ''
});
}
}
});

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared"
}

View File

@@ -0,0 +1,7 @@
<view class="com2-container">
<view style="text-align: center;">这是子组件</view>
<view style="text-align: center;">{{message}}</view>
<view class="_ui-space _px10 _pt10">
<button class="_ui-button" hover-class="_ui-button-hover" bindtap="onTap">通过事件给父组件发消息</button>
</view>
</view>