Compare commits

...

3 Commits

Author SHA1 Message Date
neverland
58fb3402b6
docs(changelog): vant v4.1.2 (#11708) 2023-03-26 12:21:42 +08:00
chenjiahan
33ba747071 release: 4.1.2 2023-03-26 12:13:09 +08:00
neverland
81d36aa9ac
docs(Field): consistent with demo (#11707) 2023-03-26 12:11:42 +08:00
8 changed files with 89 additions and 24 deletions

View File

@ -6,6 +6,7 @@
"lint": "pnpm --dir ./packages/vant lint",
"test": "pnpm --dir ./packages/vant test",
"test:watch": "pnpm --dir ./packages/vant test:watch",
"test:update": "pnpm --dir ./packages/vant test:update",
"build": "pnpm --dir ./packages/vant build",
"build:site": "pnpm --dir ./packages/vant build:site"
},

View File

@ -19,6 +19,20 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v4.1.2](https://github.com/vant-ui/vant/compare/v4.1.1...v4.1.2)
`2023-03-26`
**Feature**
- Locale: add Khmer translations [#11701](https://github.com/vant-ui/vant/issues/11701)
**Bug Fixes**
- Field: label-align top works well with label-width [#11684](https://github.com/vant-ui/vant/issues/11684)
- Field: should emit blur event when readonly [#11699](https://github.com/vant-ui/vant/issues/11699)
- ImagePreview: long vertical images sliding up and down [#11702](https://github.com/vant-ui/vant/issues/11702)
### [v4.1.1](https://github.com/vant-ui/vant/compare/v4.1.0...v4.1.1)
`2023-03-19`

View File

@ -19,6 +19,20 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v4.1.2](https://github.com/vant-ui/vant/compare/v4.1.1...v4.1.2)
`2023-03-26`
**Feature**
- Locale: 增加 Khmer 高棉语 [#11701](https://github.com/vant-ui/vant/issues/11701)
**Bug Fixes**
- Field: 修复同时设置 label-align "top" 和 is-link 时样式错误的问题 [#11684](https://github.com/vant-ui/vant/issues/11684)
- Field: 修复设置 readonly 属性后无法触发 blur 事件的问题 [#11699](https://github.com/vant-ui/vant/issues/11699)
- ImagePreview: 修复长图片上下拖动不顺滑的问题 [#11702](https://github.com/vant-ui/vant/issues/11702)
### [v4.1.1](https://github.com/vant-ui/vant/compare/v4.1.0...v4.1.1)
`2023-03-19`

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "4.1.1",
"version": "4.1.2",
"description": "Mobile UI Components built on Vue",
"main": "lib/vant.cjs.js",
"module": "es/index.mjs",

View File

@ -243,16 +243,34 @@ Use `input-align` prop to align the input value.
### Label Align
Use `label-align` prop to align the input value.
Use `label-align` prop to align the input value, can be set to `center`, `right` or `top`.
```html
<van-cell-group inset>
<van-field
v-model="value"
label="Tel"
placeholder="Please input tel number"
label="Label"
placeholder="Align Top"
label-align="top"
/>
<van-field
v-model="value2"
label="Label"
placeholder="Align Left"
label-align="left"
/>
<van-field
v-model="value3"
label="Label"
placeholder="Align Center"
label-align="center"
/>
<van-field
v-model="value4"
label="Label"
placeholder="Align Right"
label-align="right"
/>
</van-cell-group>
```

View File

@ -268,10 +268,28 @@ export default {
<van-cell-group inset>
<van-field
v-model="value"
label="手机号"
placeholder="请输入手机号"
label="文本"
placeholder="顶部对齐"
label-align="top"
/>
<van-field
v-model="value2"
label="文本"
placeholder="左对齐"
label-align="left"
/>
<van-field
v-model="value3"
label="文本"
placeholder="居中对齐"
label-align="center"
/>
<van-field
v-model="value4"
label="文本"
placeholder="右对齐"
label-align="right"
/>
</van-cell-group>
```

View File

@ -6,7 +6,7 @@ import { useTranslate } from '../../../docs/site';
const t = useTranslate({
'zh-CN': {
text: '文本',
label: '文本',
top: '顶部对齐',
center: '居中对齐',
left: '左对齐',
@ -14,11 +14,11 @@ const t = useTranslate({
labelAlign: '输入框文本位置',
},
'en-US': {
text: 'Text',
top: 'Top Align',
center: 'Center Align',
left: 'Left Align',
right: 'Right Align',
label: 'Label',
top: 'Align Top',
center: 'Align Center',
left: 'Align Left',
right: 'Align Right',
labelAlign: 'Label Align',
},
});
@ -31,25 +31,25 @@ const value = ref('');
<van-cell-group inset>
<van-field
v-model="value"
:label="t('text')"
:label="t('label')"
:placeholder="t('top')"
label-align="top"
/>
<van-field
v-model="value"
:label="t('text')"
:label="t('label')"
:placeholder="t('left')"
label-align="left"
/>
<van-field
v-model="value"
:label="t('text')"
:label="t('label')"
:placeholder="t('center')"
label-align="center"
/>
<van-field
v-model="value"
:label="t('text')"
:label="t('label')"
:placeholder="t('right')"
label-align="right"
/>

View File

@ -424,7 +424,7 @@ exports[`should render demo and match snapshot 1`] = `
<label id="van-field-label"
for="van-field-input"
>
Text
Label
</label>
</div>
<div class="van-cell__value van-field__value">
@ -432,7 +432,7 @@ exports[`should render demo and match snapshot 1`] = `
<input type="text"
id="van-field-input"
class="van-field__control"
placeholder="Top Align"
placeholder="Align Top"
aria-labelledby="van-field-label"
>
</div>
@ -443,7 +443,7 @@ exports[`should render demo and match snapshot 1`] = `
<label id="van-field-label"
for="van-field-input"
>
Text
Label
</label>
</div>
<div class="van-cell__value van-field__value">
@ -451,7 +451,7 @@ exports[`should render demo and match snapshot 1`] = `
<input type="text"
id="van-field-input"
class="van-field__control"
placeholder="Left Align"
placeholder="Align Left"
aria-labelledby="van-field-label"
>
</div>
@ -462,7 +462,7 @@ exports[`should render demo and match snapshot 1`] = `
<label id="van-field-label"
for="van-field-input"
>
Text
Label
</label>
</div>
<div class="van-cell__value van-field__value">
@ -470,7 +470,7 @@ exports[`should render demo and match snapshot 1`] = `
<input type="text"
id="van-field-input"
class="van-field__control"
placeholder="Center Align"
placeholder="Align Center"
aria-labelledby="van-field-label"
>
</div>
@ -481,7 +481,7 @@ exports[`should render demo and match snapshot 1`] = `
<label id="van-field-label"
for="van-field-input"
>
Text
Label
</label>
</div>
<div class="van-cell__value van-field__value">
@ -489,7 +489,7 @@ exports[`should render demo and match snapshot 1`] = `
<input type="text"
id="van-field-input"
class="van-field__control"
placeholder="Right Align"
placeholder="Align Right"
aria-labelledby="van-field-label"
>
</div>