# 组件名称

## 介绍

小程序自定义搜索框组件，用于搜索中间页 搜索结果页

## 代码演示

### 引入组件

```json
{
  "usingComponents": {
    "search-input": "/components/search-input/index"
  }
}
```

### 基础用法

```html
<search-input value="{{ value }}" placeholder="请输入搜索关键词" focus="{{true}}"></search-input>
```

## API

### Props

| 参数        | 说明               | 类型            | 默认值             |
| ----------- | ------------------ | --------------- | ------------------ |
| value       | 当前输入的值       | `string/number` | ``                 |
| placeholder | 输入框为空时占位符 | `string`        | `请输入搜索关键词` |
| focus       | 是否聚焦           | `boolean`       | `true`             |

<!-- ### Slots

| 名称    | 说明           |
| ------- | -------------- |
| default | 自定义插槽内容 | -->

### Events

| 事件名      | 说明           | 回调参数 |
| ----------- | -------------- | -------- |
| bind:search | 确定搜索时触发 | event    |
