mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-10-08 18:00:00 +08:00
[new feature] Field: add clearable prop
This commit is contained in:
parent
d8803abf9f
commit
a8a18505a6
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
### [v2.0.0-beta.4](https://github.com/youzan/vant/tree/v2.0.0-beta.4)
|
### [v2.0.0-beta.4](https://github.com/youzan/vant/tree/v2.0.0-beta.4)
|
||||||
|
|
||||||
|
##### Field
|
||||||
|
|
||||||
|
- 新增`clickable`属性
|
||||||
|
|
||||||
##### Stepper
|
##### Stepper
|
||||||
|
|
||||||
- 支持`Number`类型的`input-width`属性
|
- 支持`Number`类型的`input-width`属性
|
||||||
|
@ -11,7 +11,6 @@ import { Mods } from '../utils/use/bem';
|
|||||||
|
|
||||||
export type CellProps = RouteProps &
|
export type CellProps = RouteProps &
|
||||||
SharedCellProps & {
|
SharedCellProps & {
|
||||||
clickable?: boolean;
|
|
||||||
arrowDirection?: string;
|
arrowDirection?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -104,7 +103,6 @@ function Cell(
|
|||||||
Cell.props = {
|
Cell.props = {
|
||||||
...cellProps,
|
...cellProps,
|
||||||
...routeProps,
|
...routeProps,
|
||||||
clickable: Boolean,
|
|
||||||
arrowDirection: String
|
arrowDirection: String
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ export type SharedCellProps = {
|
|||||||
center?: boolean;
|
center?: boolean;
|
||||||
isLink?: boolean;
|
isLink?: boolean;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
|
clickable?: boolean;
|
||||||
titleStyle?: any;
|
titleStyle?: any;
|
||||||
titleClass?: any;
|
titleClass?: any;
|
||||||
valueClass?: any;
|
valueClass?: any;
|
||||||
@ -20,6 +21,7 @@ export const cellProps = {
|
|||||||
center: Boolean,
|
center: Boolean,
|
||||||
isLink: Boolean,
|
isLink: Boolean,
|
||||||
required: Boolean,
|
required: Boolean,
|
||||||
|
clickable: Boolean,
|
||||||
titleStyle: null as any,
|
titleStyle: null as any,
|
||||||
titleClass: null as any,
|
titleClass: null as any,
|
||||||
valueClass: null as any,
|
valueClass: null as any,
|
||||||
|
@ -130,8 +130,9 @@ Field support all native properties of input tag,such as `maxlength`、`placeh
|
|||||||
| border | Whether to show inner border | `Boolean` | `true` |
|
| border | Whether to show inner border | `Boolean` | `true` |
|
||||||
| disabled | Whether to disable field | `Boolean` | `false` |
|
| disabled | Whether to disable field | `Boolean` | `false` |
|
||||||
| readonly | Whether to be readonly | `Boolean` | `false` |
|
| readonly | Whether to be readonly | `Boolean` | `false` |
|
||||||
|
| required | Whether to show required mark | `Boolean` | `false` |
|
||||||
| clearable | Whether to be clearable | `Boolean` | `false` |
|
| clearable | Whether to be clearable | `Boolean` | `false` |
|
||||||
| required | Whether to show required mark | `Boolean` | `false`
|
| clickable | Whether to show click feedback when clicked | `Boolean` | `false` |
|
||||||
| is-link | Whether to show link icon | `Boolean` | `false` |
|
| is-link | Whether to show link icon | `Boolean` | `false` |
|
||||||
| error | Whether to show error info | `Boolean` | `false` |
|
| error | Whether to show error info | `Boolean` | `false` |
|
||||||
| error-message | Error message | `String` | `''` |
|
| error-message | Error message | `String` | `''` |
|
||||||
|
@ -262,6 +262,7 @@ export default sfc({
|
|||||||
border={this.border}
|
border={this.border}
|
||||||
isLink={this.isLink}
|
isLink={this.isLink}
|
||||||
required={this.required}
|
required={this.required}
|
||||||
|
clickable={this.clickable}
|
||||||
titleStyle={this.labelStyle}
|
titleStyle={this.labelStyle}
|
||||||
titleClass={[bem('label', labelAlign), this.labelClass]}
|
titleClass={[bem('label', labelAlign), this.labelClass]}
|
||||||
class={bem({
|
class={bem({
|
||||||
|
@ -133,8 +133,9 @@ Field 默认支持 Input 标签所有的原生属性,比如 `maxlength`、`pla
|
|||||||
| border | 是否显示内边框 | `Boolean` | `true` | - |
|
| border | 是否显示内边框 | `Boolean` | `true` | - |
|
||||||
| disabled | 是否禁用输入框 | `Boolean` | `false` | - |
|
| disabled | 是否禁用输入框 | `Boolean` | `false` | - |
|
||||||
| readonly | 是否只读 | `Boolean` | `false` | - |
|
| readonly | 是否只读 | `Boolean` | `false` | - |
|
||||||
| clearable | 是否启用清除控件 | `Boolean` | `false` | 1.1.9 |
|
|
||||||
| required | 是否显示表单必填星号 | `Boolean` | `false` | - |
|
| required | 是否显示表单必填星号 | `Boolean` | `false` | - |
|
||||||
|
| clearable | 是否启用清除控件 | `Boolean` | `false` | 1.1.9 |
|
||||||
|
| clickable | 是否开启点击反馈 | `Boolean` | `false` | 2.0.0 |
|
||||||
| is-link | 是否展示右侧箭头并开启点击反馈 | `Boolean` | `false` | 1.1.10 |
|
| is-link | 是否展示右侧箭头并开启点击反馈 | `Boolean` | `false` | 1.1.10 |
|
||||||
| error | 是否将输入内容标红 | `Boolean` | `false` | - |
|
| error | 是否将输入内容标红 | `Boolean` | `false` | - |
|
||||||
| error-message | 底部错误提示文案,为空时不展示 | `String` | `''` | -
|
| error-message | 底部错误提示文案,为空时不展示 | `String` | `''` | -
|
||||||
|
Loading…
x
Reference in New Issue
Block a user