[Doc] Search: add more api document (#1983)

This commit is contained in:
neverland 2018-10-26 16:10:40 +08:00 committed by GitHub
parent eef6c8f336
commit a995c203dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View File

@ -1,7 +1,10 @@
<template>
<demo-section>
<demo-block :title="$t('basicUsage')">
<van-search :placeholder="$t('placeholder')" v-model="value" />
<van-search
v-model="value"
:placeholder="$t('placeholder')"
/>
</demo-block>
<demo-block :title="$t('title2')">

View File

@ -56,15 +56,20 @@ Use `action` slot to custom right button, `cancel` event will no longer be trigg
```
### API
Search support all native properties of input tagsuch as `maxlength``placeholder``readonly``autofocus`
Search support all native properties of input tagsuch as `maxlength``placeholder``autofocus`
| Attribute | Description | Type | Default |
|------|------|------|------|
| placeholder | Input placeholder | `String` | - |
| background | Background color | `String` | `#f2f2f2` |
| show-action | Whether to show right button | `Boolean` | `false` |
| disabled | Whether to disable field | `Boolean` | `false` |
| readonly | Whether to be readonly | `Boolean` | `false` |
| error | Whether to show error info | `Boolean` | `false` |
| input-align | Input text align, can be set to `center` `right` | `String` | `left` |
### Event
Search support all native events of input tagsuch as `focus``blur``keypress`
| Event | Description | Arguments |

View File

@ -55,7 +55,10 @@ Search 默认支持 Input 标签所有的原生属性,比如 `maxlength`、`pl
|------|------|------|------|------|
| background | 搜索框背景色 | `String` | `#f2f2f2` | - |
| show-action | 是否在搜索框右侧显示取消按钮 | `Boolean` | `false` | - |
| disabled | 是否禁用输入框 | `Boolean` | `false` | - |
| readonly | 是否只读 | `Boolean` | `false` | - |
| error | 是否将输入内容标红 | `Boolean` | `false` | - |
| input-align | 输入框内容对齐方式,可选值为 `center` `right` | `String` | `left` | - |
### Event

View File

@ -4,7 +4,7 @@ exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe__track" style="width:0px;height:;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
@ -15,7 +15,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe__track" style="width:0px;height:;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
<img>
</div>
@ -34,7 +34,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe__track" style="width:0px;height:;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
@ -45,7 +45,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="demo-swipe--vertical van-swipe">
<div class="van-swipe__track" style="height:0px;transition-duration:500ms;transform:translateY(0px);">
<div class="van-swipe__track" style="height:0px;width:;transition-duration:500ms;transform:translateY(0px);">
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">3</div>
@ -56,7 +56,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe__track" style="width:0px;height:;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
@ -67,7 +67,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe__track" style="width:0px;height:;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>