feat(components): 添加搜索弹窗组件并优化弹窗插件

添加了新的 search-popup 组件,包含完整的搜索和筛选功能,
支持扫码、输入搜索、自定义插槽等特性。同时优化了 popup-plugin
组件的代码结构,移除了调试日志并改进了模板格式。
This commit is contained in:
zhengw
2026-01-09 15:26:10 +08:00
parent 779ea81406
commit 0c4b2a886c
6 changed files with 163 additions and 11 deletions

View File

@@ -18,10 +18,8 @@ Component({
*/
methods: {
onVisibleChange(e: any) {
console.log(e.detail.visible);
this.setData({
open: e.detail.visible,
});
// console.log(e.detail.visible);
this.setData({ open: e.detail.visible });
if (!e.detail.visible) {
this.triggerEvent("close");
}

View File

@@ -1,8 +1,14 @@
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="{{placement || 'bottom'}}" close-btn>
<view style="border-bottom: 1px solid #ddd;">
<view style="padding: 12px 12px;">{{title}}</view>
</view>
<view style="max-height: 70vh;overflow: auto;">
<slot></slot>
</view>
<t-popup
visible="{{visible}}"
bind:visible-change="onVisibleChange"
placement="{{placement || 'bottom'}}"
close-btn
>
<view style="border-bottom: 1px solid #ddd;">
<view style="padding: 12px 12px;">{{title}}</view>
</view>
<view style="max-height: 70vh;overflow: auto;">
<slot/>
</view>
</t-popup>