Search 搜索
支持平台
| 安卓 | ios | web | 微信小程序 | 支付宝小程序 | QQ小程序 |
|---|---|---|---|---|---|
| √ | √ | √ | x | x | x |
示例
html
<template>
<t-page title="搜索" class="p.30">
<t-card class="mb.30" title="Search 搜索" sub-title="可根据业务需求调整组件样式和功能,实现更丰富的搜索体验。"></t-card>
<t-section class="mb.30" title="基础使用"></t-section>
<t-search class="tdb" type="error" v-model="inputvalue" @search="onSearch">
</t-search>
</t-page>
</template>
<script>
export default {
data() {
return {
inputvalue: ''
};
},
methods: {
onSearch() {
console.log('搜索')
}
}
}
</script>
<style lang="scss">
</style>Props
| 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| type | 组件场景 | String | '' |
| width | 组件宽度 | String | '' |
| height | 组件高度 | String | '' |
| margin | 外边距 | String | '' |
| padding | 内边距 | String | '' |
| radius | 圆角 | String | '' |
| sty | 自定义样式类 | String | '' |
| customStyle | 自定义样式 | Object | '' |
| backgroundColor | 背景颜色 | String | '' |
| disabled | 是否禁用组件 | Boolean | false |
| stop | 是否阻止事件冒泡 | Boolean | false |
| hover | 是否有悬浮效果 | Boolean | false |
| effect | 特殊效果 | String | 'normal' |
| size | 按钮尺寸 | String | 'medium' |
| modelValue | 绑定的值 | String | '' |
| buttonText | 按钮文本 | String | '搜索' |
Events
| 名称 | 描述 | 参数 |
|---|---|---|
| search | 当点击搜索按钮时触发 | - |
| update:modelValue | 当输入框的值更新时触发 | 更新的值 |
| prefixClick | 当点击前缀图标时触发 | - |
