first add files
This commit is contained in:
22
ProjectLiaisonForm/pages/search/base/index.js
Normal file
22
ProjectLiaisonForm/pages/search/base/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
Component({
|
||||
data: {
|
||||
value: '',
|
||||
resultList: [],
|
||||
},
|
||||
methods: {
|
||||
onChangeValue(e) {
|
||||
const { value } = e.detail;
|
||||
const list = [
|
||||
'tdesign-vue',
|
||||
'tdesign-react',
|
||||
'tdesign-miniprogram',
|
||||
'tdesign-angular',
|
||||
'tdesign-mobile-vue',
|
||||
'tdesign-mobile-react',
|
||||
];
|
||||
this.setData({
|
||||
resultList: value ? list.filter((v) => v.includes(value)) : [],
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
5
ProjectLiaisonForm/pages/search/base/index.json
Normal file
5
ProjectLiaisonForm/pages/search/base/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-search": "tdesign-miniprogram/search/search"
|
||||
}
|
||||
}
|
||||
7
ProjectLiaisonForm/pages/search/base/index.wxml
Normal file
7
ProjectLiaisonForm/pages/search/base/index.wxml
Normal file
@@ -0,0 +1,7 @@
|
||||
<view class="example-search">
|
||||
<t-search placeholder="搜索预设文案" />
|
||||
</view>
|
||||
|
||||
<view class="example-search">
|
||||
<t-search placeholder="输入tdesign,有预览结果" resultList="{{resultList}}" bind:change="onChangeValue" />
|
||||
</view>
|
||||
8
ProjectLiaisonForm/pages/search/base/index.wxss
Normal file
8
ProjectLiaisonForm/pages/search/base/index.wxss
Normal file
@@ -0,0 +1,8 @@
|
||||
.example-search {
|
||||
background-color: var(--bg-color-demo);
|
||||
padding: 16rpx 32rpx;
|
||||
}
|
||||
|
||||
.example-search:not(:last-child) {
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user