搜索框
基本使用
- 组件内部已经设置的防抖函数,外部通过监听输入的改变进行接口调用
vue
<template>
<jp-searchbar :value="attribute.keyword" place-text="客户名称、门店、工单号关键字" @text-change="searchbarChange"></jp-searchbar>
</template>
<script lang="ts" setup>
import { reactive } from 'vue'
const attribute = reactive({
keyword: ''
})
const searchbarChange = (e) => {
console.log(e)
}
</script>
<style scoped lang="scss"></style>
props
v-model 配置:
prop: 'value'event: 'clickDone'
属性列表:
| 属性名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| value | String | '' | 输入框的值 |
| placeText | String | '请输入搜索关键字' | 输入框的占位文字 |
| disable | Boolean | false | 是否禁用输入框 |
| placeholderStyle | String | '' | 占位文字样式 |
事件列表:
| 事件名 | 描述 |
|---|---|
| text-change | 文本内容发生变化时触发的事件 |
| search-click | 点击搜索时触发的事件 |
| click-done | 点击完成时触发的事件 |