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,40 @@
Page({
onShareAppMessage() {
return {
title: 'template',
path: '/component-case/template/template',
};
},
data: {
value: '',
value2: '',
},
onReady() {
// debugger
// setTimeout(() => {
// }, 3000)
},
onClick() {
this.setData('value', this.data.value2);
},
onClick2() {
// const res = this.selectComponent('#child');
// res.onClick();
this.setData({
value: '',
});
},
onInput(e) {
this.data.value2 = e.detail.value;
},
onMyevent() {
this.onClick2();
}
});

View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "模版引用",
"usingComponents": {
"showbox": "../../common/component/showbox/index",
"box": "../../common/component/container/index",
"example": "../../common/component/example/index"
}
}

View File

@@ -0,0 +1,17 @@
<import src="../../common/template.xhsml" />
<view class="container">
<showbox title="template与组件内外通信">
<box pad="10px">
<view class="_ui-space">
<example id="child" value="{{value}}" bindmyevent="onMyevent"></example>
<template is="template" data="{{ value: value }}"></template>
<view class="_ui-input">
<input placeholder="输入修改的value" placeholder-style="color: #3333334D;" bindinput="onInput"/>
</view>
<button class="_ui-button" bindtap="onClick" hover-class="_ui-button-hover">点击修改value</button>
<button class="_ui-button" bindtap="onClick2" hover-class="_ui-button-hover">组件外重置value</button>
</view>
</box>
</showbox>
</view>