diff --git a/docs/examples-docs/actionsheet.md b/docs/examples-docs/actionsheet.md index 592afbad9..ff6021f63 100644 --- a/docs/examples-docs/actionsheet.md +++ b/docs/examples-docs/actionsheet.md @@ -86,3 +86,24 @@ export default { ``` ::: + +### API + +| 参数 | 说明 | 类型 | 默认值 | 可选值 | +|-----------|-----------|-----------|-------------|-------------| +| actions | 行动按钮数组 | Array | [] | | +| title | 标题 | String | | | +| cancelText | 取消按钮文案 | String | | | +| overlay | 是否显示遮罩 | Boolean | | | +| closeOnClickOverlay | 点击遮罩是否关闭ActionSheet | Boolean | | | + +### actions + +`API`中的`actions`为一个对象数组,数组中的每一个对象配置每一列,每一列有以下`key`: + +| key | 说明 | +|-----------|-----------| +| name | 标题 | +| subname | 二级标题 | +| className | 为对应列添加特殊的`class` | +| loading | 是否是loading状态 | diff --git a/docs/examples-docs/field.md b/docs/examples-docs/field.md index bf78de558..a77ef1f71 100644 --- a/docs/examples-docs/field.md +++ b/docs/examples-docs/field.md @@ -1,3 +1,13 @@ + + ## Field组件 表单中`input`或`textarea`的输入框。 @@ -9,7 +19,7 @@ :::demo 基础用法 ```html - + @@ -28,14 +38,26 @@ ``` ::: -### 监听change事件 +### 禁用的输入框 -监听组件的`change`事件。 +传入`disabled`属性即可。 -:::demo 监听change事件 +:::demo 禁用的输入框 ```html - + + +``` +::: + +### 错误的输入框 + +传入`error`属性即可。 + +:::demo 禁用的输入框 +```html + + ``` ::: @@ -49,6 +71,7 @@ | value | 输入框的值 | string | '' | | | label | 输入框标签 | string | '' | | | disabled | 是否禁用输入框 | boolean | false | | +| error | 输入框是否有错误 | boolean | false | | | readonly | 输入框是否只读 | boolean | false | | | maxlength | 输入框maxlength | [String, Number] | '' | | diff --git a/docs/examples-docs/icon.md b/docs/examples-docs/icon.md new file mode 100644 index 000000000..cc1d18579 --- /dev/null +++ b/docs/examples-docs/icon.md @@ -0,0 +1,43 @@ + + +## Icon + +### 所有Icon + +:::demo 所有Icon +```html + + + + + + + + + + + + + + + + + +``` +::: + +### API + +| 参数 | 说明 | 类型 | 默认值 | 可选值 | +|-----------|-----------|-----------|-------------|-------------| +| name | icon名称 | string | '' | | diff --git a/docs/nav.config.json b/docs/nav.config.json index 83bf82ac3..498fc0ef2 100644 --- a/docs/nav.config.json +++ b/docs/nav.config.json @@ -27,6 +27,10 @@ "path": "/button", "title": "Button" }, + { + "path": "/icon", + "title": "Icon" + }, { "path": "/cell", "title": "Cell" diff --git a/packages/field/src/field.vue b/packages/field/src/field.vue index 6571e2c91..8d10b122b 100644 --- a/packages/field/src/field.vue +++ b/packages/field/src/field.vue @@ -3,14 +3,15 @@ class="zan-field" :title="label" :class="{ - 'is-textarea': type === 'textarea', - 'is-nolabel': !label + 'zan-field--hastextarea': type === 'textarea', + 'zan-field--nolabel': !label, + 'zan-field--disabled': disabled, + 'zan-field--error': error }">