mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs: fix field value #7817
This commit is contained in:
parent
a524b5284f
commit
4d49183230
@ -296,10 +296,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="picker"
|
||||
:value="state.value"
|
||||
label="Picker"
|
||||
placeholder="Select city"
|
||||
@click="state.showPicker = true"
|
||||
@ -342,10 +342,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="datetimePicker"
|
||||
:value="state.value"
|
||||
label="Datetime Picker"
|
||||
placeholder="Select time"
|
||||
@click="state.showPicker = true"
|
||||
@ -385,10 +385,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="area"
|
||||
:value="state.value"
|
||||
label="Area Picker"
|
||||
placeholder="Select area"
|
||||
@click="state.showArea = true"
|
||||
@ -432,10 +432,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="calendar"
|
||||
:value="state.value"
|
||||
label="Calendar"
|
||||
placeholder="Select date"
|
||||
@click="state.showCalendar = true"
|
||||
|
@ -323,10 +323,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="picker"
|
||||
:value="state.value"
|
||||
label="选择器"
|
||||
placeholder="点击选择城市"
|
||||
@click="state.showPicker = true"
|
||||
@ -371,10 +371,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="datetimePicker"
|
||||
:value="state.value"
|
||||
label="时间选择"
|
||||
placeholder="点击选择时间"
|
||||
@click="state.showPicker = true"
|
||||
@ -416,10 +416,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="area"
|
||||
:value="state.value"
|
||||
label="地区选择"
|
||||
placeholder="点击选择省市区"
|
||||
@click="state.showArea = true"
|
||||
@ -465,10 +465,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="state.value"
|
||||
readonly
|
||||
clickable
|
||||
name="calendar"
|
||||
:value="state.value"
|
||||
label="日历"
|
||||
placeholder="点击选择日期"
|
||||
@click="state.showCalendar = true"
|
||||
|
@ -1,9 +1,21 @@
|
||||
<template>
|
||||
<demo-block :title="t('basicUsage')">
|
||||
<van-row>
|
||||
<van-image width="100" height="100" :src="image" />
|
||||
</van-row>
|
||||
</demo-block>
|
||||
<img
|
||||
v-if="lazyLoad"
|
||||
v-lazy="src"
|
||||
ref="imageRef"
|
||||
:alt="alt"
|
||||
:class="bem('image')"
|
||||
:style="{ objectFit: fit }"
|
||||
/>;
|
||||
<img
|
||||
v-else
|
||||
:src="src"
|
||||
:alt="alt"
|
||||
:class="bem('image')"
|
||||
:style="{ objectFit: fit }"
|
||||
@load="onLoad"
|
||||
@error="onError"
|
||||
/>
|
||||
|
||||
<demo-block :title="t('fitMode')">
|
||||
<van-row gutter="20">
|
||||
|
@ -118,7 +118,7 @@ Use `title` prop to set keyboard title.
|
||||
### Bind Value
|
||||
|
||||
```html
|
||||
<van-field readonly clickable :value="value" @touchstart.stop="show = true" />
|
||||
<van-field v-model="value" readonly clickable @touchstart.stop="show = true" />
|
||||
<van-number-keyboard
|
||||
v-model="value"
|
||||
:show="show"
|
||||
|
@ -131,7 +131,7 @@ export default {
|
||||
可以通过 `v-model` 绑定键盘当前输入值。
|
||||
|
||||
```html
|
||||
<van-field readonly clickable :value="value" @touchstart.stop="show = true" />
|
||||
<van-field v-model="value" readonly clickable @touchstart.stop="show = true" />
|
||||
<van-number-keyboard
|
||||
v-model="value"
|
||||
:show="show"
|
||||
|
@ -216,10 +216,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="value"
|
||||
readonly
|
||||
clickable
|
||||
label="City"
|
||||
:value="value"
|
||||
placeholder="Choose City"
|
||||
@click="showPicker = true"
|
||||
/>
|
||||
|
@ -240,10 +240,10 @@ export default {
|
||||
|
||||
```html
|
||||
<van-field
|
||||
v-model="value"
|
||||
readonly
|
||||
clickable
|
||||
label="城市"
|
||||
:value="value"
|
||||
placeholder="选择城市"
|
||||
@click="showPicker = true"
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user