first add files

This commit is contained in:
2025-08-15 14:05:08 +08:00
parent c58f74bcc0
commit b6216570d9
2451 changed files with 29056 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
Component({
data: {
cur: {},
position: [
{ value: 'top', text: '顶部弹出' },
{ value: 'left', text: '左侧弹出' },
{ value: 'center', text: '中间弹出' },
{ value: 'bottom', text: '底部弹出' },
{ value: 'right', text: '右侧弹出' },
],
},
methods: {
handlePopup(e) {
const { item } = e.currentTarget.dataset;
this.setData(
{
cur: item,
},
() => {
this.setData({ visible: true });
},
);
},
onVisibleChange(e) {
this.setData({
visible: e.detail.visible,
});
},
onClose() {
this.setData({
visible: false,
});
},
},
});

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"t-popup": "tdesign-miniprogram/popup/popup",
"t-icon": "tdesign-miniprogram/icon/icon",
"t-button": "tdesign-miniprogram/button/button"
}
}

View File

@@ -0,0 +1,9 @@
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="center">
<view class="block">
<t-icon t-class="close-btn" name="close-circle" size="64rpx" color="#fff" bind:tap="onClose" />
</view>
</t-popup>
<t-button block size="large" variant="outline" theme="primary" bind:tap="handlePopup">
居中弹出层-带自定义关闭按钮
</t-button>

View File

@@ -0,0 +1,14 @@
.block {
position: relative;
width: 240px;
height: 240px;
background: var(--td-bg-color-container);
border-radius: 16rpx;
}
.close-btn {
position: absolute;
left: 50%;
margin-left: -32rpx;
bottom: calc(-1 * (48rpx + 64rpx));
}