docs(Search): missing value in basic usage

This commit is contained in:
chenjiahan 2020-10-24 20:47:02 +08:00
parent 386956b08b
commit 4a047a8af3
2 changed files with 13 additions and 1 deletions

View File

@ -20,7 +20,9 @@ Vue.use(Search);
```js
export default {
data() {
value: '';
return {
value: '',
};
},
};
```

View File

@ -23,6 +23,16 @@ Vue.use(Search);
<van-search v-model="value" placeholder="请输入搜索关键词" />
```
```js
export default {
data() {
return {
value: '',
};
},
};
```
### 事件监听
Search 组件提供了 `search``cancel` 事件,`search` 事件在点击键盘上的搜索/回车按钮后触发,`cancel` 事件在点击搜索框右侧取消按钮时触发。