mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 18:00:27 +08:00
[Doc] Search: add more api document (#1983)
This commit is contained in:
parent
eef6c8f336
commit
a995c203dc
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<demo-section>
|
<demo-section>
|
||||||
<demo-block :title="$t('basicUsage')">
|
<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>
|
||||||
|
|
||||||
<demo-block :title="$t('title2')">
|
<demo-block :title="$t('title2')">
|
||||||
|
@ -56,15 +56,20 @@ Use `action` slot to custom right button, `cancel` event will no longer be trigg
|
|||||||
```
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
Search support all native properties of input tag,such as `maxlength`、`placeholder`、`readonly`、`autofocus`
|
|
||||||
|
Search support all native properties of input tag,such as `maxlength`、`placeholder`、`autofocus`
|
||||||
|
|
||||||
| Attribute | Description | Type | Default |
|
| Attribute | Description | Type | Default |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| placeholder | Input placeholder | `String` | - |
|
|
||||||
| background | Background color | `String` | `#f2f2f2` |
|
| background | Background color | `String` | `#f2f2f2` |
|
||||||
| show-action | Whether to show right button | `Boolean` | `false` |
|
| 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
|
### Event
|
||||||
|
|
||||||
Search support all native events of input tag,such as `focus`、`blur`、`keypress`
|
Search support all native events of input tag,such as `focus`、`blur`、`keypress`
|
||||||
|
|
||||||
| Event | Description | Arguments |
|
| Event | Description | Arguments |
|
||||||
|
@ -55,7 +55,10 @@ Search 默认支持 Input 标签所有的原生属性,比如 `maxlength`、`pl
|
|||||||
|------|------|------|------|------|
|
|------|------|------|------|------|
|
||||||
| background | 搜索框背景色 | `String` | `#f2f2f2` | - |
|
| background | 搜索框背景色 | `String` | `#f2f2f2` | - |
|
||||||
| show-action | 是否在搜索框右侧显示取消按钮 | `Boolean` | `false` | - |
|
| show-action | 是否在搜索框右侧显示取消按钮 | `Boolean` | `false` | - |
|
||||||
|
| disabled | 是否禁用输入框 | `Boolean` | `false` | - |
|
||||||
| readonly | 是否只读 | `Boolean` | `false` | - |
|
| readonly | 是否只读 | `Boolean` | `false` | - |
|
||||||
|
| error | 是否将输入内容标红 | `Boolean` | `false` | - |
|
||||||
|
| input-align | 输入框内容对齐方式,可选值为 `center` `right` | `String` | `left` | - |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<div class="van-swipe">
|
<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);">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);">2</div>
|
||||||
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</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>
|
<div>
|
||||||
<div class="van-swipe">
|
<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);">
|
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
|
||||||
<img>
|
<img>
|
||||||
</div>
|
</div>
|
||||||
@ -34,7 +34,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="van-swipe">
|
<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);">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);">2</div>
|
||||||
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</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>
|
<div>
|
||||||
<div class="demo-swipe--vertical van-swipe">
|
<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);">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);">2</div>
|
||||||
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">3</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>
|
<div>
|
||||||
<div class="van-swipe">
|
<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);">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);">2</div>
|
||||||
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</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>
|
<div>
|
||||||
<div class="van-swipe">
|
<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);">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);">2</div>
|
||||||
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
|
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user