添加组件及页面
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input"
|
||||
}
|
||||
}
|
||||
24
miniprogram/pages/components/search-input/search-input.ts
Normal file
24
miniprogram/pages/components/search-input/search-input.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
Component({
|
||||
options: { multipleSlots: true },
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: { label: null },
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onChange(e: any) {
|
||||
this.triggerEvent('change', { value: e.detail.value });
|
||||
},
|
||||
onClear() {
|
||||
this.triggerEvent('change', { value: '' });
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<t-input label="{{label}}" bind:change="onChange" bind:clear="onClear" clearable />
|
||||
Reference in New Issue
Block a user