diff --git a/packages/nutui-taro-demo/src/dentry/pages/calendar/index.vue b/packages/nutui-taro-demo/src/dentry/pages/calendar/index.vue index 315df60b15..e289ddaf7e 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/calendar/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/calendar/index.vue @@ -6,13 +6,13 @@ @@ -104,13 +104,13 @@ - diff --git a/packages/nutui-taro-demo/src/dentry/pages/cascader/index.vue b/packages/nutui-taro-demo/src/dentry/pages/cascader/index.vue index 3223eb6a6f..d0b910a4df 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/cascader/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/cascader/index.vue @@ -68,203 +68,184 @@ - diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue index 8e5716e2b8..7b4e3afb3d 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue @@ -3,36 +3,36 @@
- 复选框 + 复选框 - 复选框 + 复选框 - 复选框 + 复选框 - 未选时禁用状态 + 未选时禁用状态 - 选中时禁用状态 + 选中时禁用状态 - 自定义尺寸25 + 自定义尺寸25 - 自定义尺寸10 + 自定义尺寸10 - 自定义图标 @@ -41,12 +41,12 @@ - change复选框 + change复选框 - + 组合复选框 组合复选框 组合复选框 @@ -55,12 +55,12 @@
当前选中值
-
{{ checkboxgroup1 }}
+
{{ data.checkboxgroup1 }}
- + 组合复选框 组合复选框 组合复选框 @@ -70,8 +70,8 @@ - - {{ + + {{ item.value }} @@ -84,7 +84,7 @@ - + 组合复选框 组合复选框 组合复选框 @@ -93,14 +93,16 @@
当前选中值
-
{{ checkboxgroup4 }}
+
{{ data.checkboxgroup4 }}
- 全选 + 全选 - + 组合复选框 组合复选框 组合复选框 @@ -109,7 +111,7 @@ - + 按钮形状 按钮形状 @@ -117,105 +119,82 @@ - diff --git a/packages/nutui-taro-demo/src/dentry/pages/form/index.vue b/packages/nutui-taro-demo/src/dentry/pages/form/index.vue index f71f954466..83b7de76d5 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/form/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/form/index.vue @@ -165,216 +165,186 @@ - diff --git a/packages/nutui-taro-demo/src/dentry/pages/numberkeyboard/index.vue b/packages/nutui-taro-demo/src/dentry/pages/numberkeyboard/index.vue index 410cae73c2..1b49990ab4 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/numberkeyboard/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/numberkeyboard/index.vue @@ -45,59 +45,33 @@ - ``` @@ -137,18 +116,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -199,18 +167,18 @@ app.use(Calendar); When set to week selection, the start and end dates of the week will be determined according to `first-day-of-week`. For example, when `first-day-of-week` is 0, the start date of a week is Sunday. In other cases, the start date of the week is Monday. :::demo -```html +```vue - ``` @@ -264,51 +221,41 @@ When set to week selection, the start and end dates of the week will be determin :::demo -```html +```vue - ``` @@ -318,18 +265,18 @@ When set to week selection, the start and end dates of the week will be determin :::demo -```html +```vue - ``` @@ -378,18 +315,19 @@ When set to week selection, the start and end dates of the week will be determin :::demo -```html +```vue - - ``` @@ -515,18 +440,18 @@ When set to week selection, the start and end dates of the week will be determin :::demo -```html +```vue - ``` ::: -### Custom First Day Of Week +### Custom Footer v4.1.6 :::demo -```html +```vue - ``` ::: -### Custom Footer v4.1.6 +### Custom First Day Of Week :::demo -```html +```vue - - + ``` ::: @@ -701,12 +600,12 @@ When set to week selection, the start and end dates of the week will be determin :::demo -```html +```vue - ``` ::: +## API + ### Props -| Attribute | Description | Type | Default | -| ----------------- | --------------------------------------------------------------- | ------------------ | --------------------- | -| v-model:visible | whether to show | boolean | `false` | -| type | Calendar type :`one` `range` `multiple` `week(V4.0.1)` | string | `one` | -| poppable | Whether to display the pop-up window | boolean | `true` | -| is-auto-back-fill | Automatic backfill | boolean | `false` | -| title | whether to show title | string | `Calendar` | -| default-value | Default value, select single date : `string`,other: `string[]` | string \| string[] | `null` | -| start-date | The start date | string | `Today` | -| end-date | The end date | string | `365 days from today` | -| show-today | Whether to show today's mark | boolean | `true` | -| start-text | Range selection, start part of the text | string | `Start` | -| end-text | Range selection, end part of the text | string | `End` | -| confirm-text | Bottom confirm button text | string | `Confirm` | -| show-title | Whether to show the calendar title | boolean | `true` | -| show-sub-title | Whether to display the date title | boolean | `true` | -| to-date-animation | Whether to use scroll animation | boolean | `true` | -| first-day-of-week | Set the start day of week | 0-6 | `0` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model:visible | whether to show | boolean | `false` | +| type | Calendar type :`one` `range` `multiple` `week(V4.0.1)` | string | `one` | +| poppable | Whether to display the pop-up window | boolean | `true` | +| is-auto-back-fill | Automatic backfill | boolean | `false` | +| title | whether to show title | string | `Calendar` | +| default-value | Default value, select single date : `string`,other: `string[]` | string \| string[] | `null` | +| start-date | The start date | string | `Today` | +| end-date | The end date | string | `365 days from today` | +| show-today | Whether to show today's mark | boolean | `true` | +| start-text | Range selection, start part of the text | string | `Start` | +| end-text | Range selection, end part of the text | string | `End` | +| confirm-text | Bottom confirm button text | string | `Confirm` | +| show-title | Whether to show the calendar title | boolean | `true` | +| show-sub-title | Whether to display the date title | boolean | `true` | +| to-date-animation | Whether to use scroll animation | boolean | `true` | +| first-day-of-week | Set the start day of week | 0-6 | `0` | ### Events -| Event | Description | Arguments | -| ------ | ---------------------------------------------------------------------------------------------------------------- | ------------------------ | +| Event | Description | Arguments | +| --- | --- | --- | | choose | Triggered after selection or by clicking the confirm button,Array of dates (including year, month, day and week) | `(string \| string[])[]` | -| close | Triggered when closed | - | -| select | Triggered after click/select | `(string \| string[])[]` | +| close | Triggered when closed | - | +| select | Triggered after click/select | `(string \| string[])[]` | ### Slots -| Name | Description | -| ------------------- | ------------------------------------------------------------ | -| btn | Below the custom calendar header, you can add custom actions | -| day | Date information | -| top-info | Date top information | -| bottom-info | Date bottom information | -| footer-info`v4.1.6` | Custom calendar Footer, replace confirm btn | +| Name | Description | +| --- | --- | +| btn | Below the custom calendar header, you can add custom actions | +| day | Date information | +| top-info | Date top information | +| bottom-info | Date bottom information | +| footer-info`v4.1.6` | Custom calendar Footer, replace confirm btn | ### Methods Through [ref](https://vuejs.org/guide/essentials/template-refs.html), you can get the Calendar instance and call the instance method. -| Name | Description | Arguments | -| --------------------- | ------------------------------------------------------ | --------- | -| scrollToDate | Scroll to the month of the specified date:'2021-12-30' | `string` | -| initPosition `v4.0.1` | Initialize scroll position | | +| Name | Description | Arguments | +| --- | --- | --- | +| scrollToDate | Scroll to the month of the specified date:'2021-12-30' | `string` | +| initPosition `v4.0.1` | Initialize scroll position | | ## Theming @@ -798,20 +691,20 @@ Through [ref](https://vuejs.org/guide/essentials/template-refs.html), you can ge The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| --------------------------------------- | -------------------------- | -| --nut-calendar-primary-color | _var(--nut-primary-color)_ | -| --nut-calendar-choose-color | _var(--nut-primary-color)_ | -| --nut-calendar-choose-font-color | _var(--nut-primary-color)_ | -| --nut-calendar-base-color | _#333333_ | -| --nut-calendar-disable-color | _#d1d0d0_ | -| --nut-calendar-base-font | _var(--nut-font-size-3)_ | -| --nut-calendar-title-font | _var(--nut-font-size-4)_ | -| --nut-calendar-title-font-weight | _500_ | -| --nut-calendar-sub-title-font | _var(--nut-font-size-2)_ | -| --nut-calendar-text-font | _var(--nut-font-size-1)_ | -| --nut-calendar-day-font | _16px_ | -| --nut-calendar-day-active-border-radius | _0px_ | -| --nut-calendar-day-font-weight | _500_ | -| --nut-calendar-day67-font-color | _var(--nut-primary-color)_ | -| --nut-calendar-month-title-font-size | _inherit_ | +| Name | Default Value | +| --- | --- | +| --nut-calendar-primary-color | _var(--nut-primary-color)_ | +| --nut-calendar-choose-color | _var(--nut-primary-color)_ | +| --nut-calendar-choose-font-color | _var(--nut-primary-color)_ | +| --nut-calendar-base-color | _#333333_ | +| --nut-calendar-disable-color | _#d1d0d0_ | +| --nut-calendar-base-font | _var(--nut-font-size-3)_ | +| --nut-calendar-title-font | _var(--nut-font-size-4)_ | +| --nut-calendar-title-font-weight | _500_ | +| --nut-calendar-sub-title-font | _var(--nut-font-size-2)_ | +| --nut-calendar-text-font | _var(--nut-font-size-1)_ | +| --nut-calendar-day-font | _16px_ | +| --nut-calendar-day-active-border-radius | _0px_ | +| --nut-calendar-day-font-weight | _500_ | +| --nut-calendar-day67-font-color | _var(--nut-primary-color)_ | +| --nut-calendar-month-title-font-size | _inherit_ | diff --git a/src/packages/__VUE/calendar/doc.md b/src/packages/__VUE/calendar/doc.md index 3ba1f22da1..7a413ccc7e 100644 --- a/src/packages/__VUE/calendar/doc.md +++ b/src/packages/__VUE/calendar/doc.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { Calendar } from '@nutui/nutui'; @@ -18,18 +18,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -73,18 +63,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -137,18 +116,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -197,20 +165,21 @@ app.use(Calendar); ### 选择周 当设置为周选择时,会根据`first-day-of-week` 判断周的起始与结束日期。如`first-day-of-week`为 0 时,一周的起始日期为星期日。其他情况时,一周的起始日期为星期一。 + :::demo -```html +```vue - ``` @@ -264,46 +222,41 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -313,18 +266,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -373,19 +316,19 @@ app.use(Calendar); :::demo -```html +```vue - - ``` @@ -518,18 +447,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -587,62 +506,51 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -652,54 +560,44 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -709,12 +607,12 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -756,51 +646,51 @@ app.use(Calendar); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ----------------- | ------------------------------------------------------------------------------ | ------------------ | ----------------- | -| v-model:visible | 是否可见 | boolean | `false` | -| type | 类型,日期单择`one`,区间选择`range`,日期多选`multiple`,周选择`week`(`v4.0.1`) | string | '`one`' | -| poppable | 是否弹窗状态展示 | boolean | `true` | -| is-auto-back-fill | 自动回填 | boolean | `false` | -| title | 显示标题 | string | `日期选择` | -| default-value | 默认值,单个日期选择 `string`,其他为 `string[]` | string \| string[] | `null` | -| start-date | 开始日期 | string | `今天` | -| end-date | 结束日期 | string | `距离今天 365 天` | -| show-today | 是否展示今天标记 | boolean | `true` | -| start-text | 范围选择,开始信息文案 | string | `开始` | -| end-text | 范围选择,结束信息文案 | string | `结束` | -| confirm-text | 底部确认按钮文案 | string | `确认` | -| show-title | 是否在展示日历标题 | boolean | `true` | -| show-sub-title | 是否展示日期标题 | boolean | `true` | -| to-date-animation | 是否启动滚动动画 | boolean | `true` | -| first-day-of-week | 设置周起始日 | 0-6 | `0` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model:visible | 是否可见 | boolean | `false` | +| type | 类型,日期单择`one`,区间选择`range`,日期多选`multiple`,周选择`week`(`v4.0.1`) | string | '`one`' | +| poppable | 是否弹窗状态展示 | boolean | `true` | +| is-auto-back-fill | 自动回填 | boolean | `false` | +| title | 显示标题 | string | `日期选择` | +| default-value | 默认值,单个日期选择 `string`,其他为 `string[]` | string \| string[] | `null` | +| start-date | 开始日期 | string | `今天` | +| end-date | 结束日期 | string | `距离今天 365 天` | +| show-today | 是否展示今天标记 | boolean | `true` | +| start-text | 范围选择,开始信息文案 | string | `开始` | +| end-text | 范围选择,结束信息文案 | string | `结束` | +| confirm-text | 底部确认按钮文案 | string | `确认` | +| show-title | 是否在展示日历标题 | boolean | `true` | +| show-sub-title | 是否展示日期标题 | boolean | `true` | +| to-date-animation | 是否启动滚动动画 | boolean | `true` | +| first-day-of-week | 设置周起始日 | 0-6 | `0` | ### Events -| 事件名 | 说明 | 回调参数 | -| ------ | --------------------------------------------------------- | ------------------------ | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | choose | 选择之后或是点击确认按钮触发,日期数组(包含年月日和星期) | `(string \| string[])[]` | -| close | 关闭时触发 | - | -| select | 点击/选择后触发 | `(string \| string[])[]` | +| close | 关闭时触发 | - | +| select | 点击/选择后触发 | `(string \| string[])[]` | ### Slots -| 名称 | 说明 | -| ------------------- | ---------------------------------------- | -| btn | 自定义日历标题下部,可用以添加自定义操作 | -| day | 日期信息 | -| top-info | 日期顶部信息 | -| bottom-info | 日期底部信息 | -| footer-info`v4.1.6` | 日历自定义底部,替代confirm按钮 | +| 名称 | 说明 | +| --- | --- | +| btn | 自定义日历标题下部,可用以添加自定义操作 | +| day | 日期信息 | +| top-info | 日期顶部信息 | +| bottom-info | 日期底部信息 | +| footer-info`v4.1.6` | 日历自定义底部,替代confirm按钮 | ### Methods 通过 [ref](https://vuejs.org/guide/essentials/template-refs.html) 可以获取到 `Calendar` 实例并调用实例方法。 -| 方法名 | 说明 | 参数 | -| --------------------- | ------------------------------------- | -------- | -| scrollToDate | 滚动到指定日期所在月,如:'2021-12-30' | `string` | -| initPosition `v4.0.1` | 初始化滚动位置 | 无 | +| 方法名 | 说明 | 参数 | +| --- | --- | --- | +| scrollToDate | 滚动到指定日期所在月,如:'2021-12-30' | `string` | +| initPosition `v4.0.1` | 初始化滚动位置 | 无 | ## 主题定制 @@ -808,20 +698,20 @@ app.use(Calendar); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| --------------------------------------- | -------------------------- | -| --nut-calendar-primary-color | _var(--nut-primary-color)_ | -| --nut-calendar-choose-color | _var(--nut-primary-color)_ | -| --nut-calendar-choose-font-color | _var(--nut-primary-color)_ | -| --nut-calendar-base-color | _#333333_ | -| --nut-calendar-disable-color | _#d1d0d0_ | -| --nut-calendar-base-font | _var(--nut-font-size-3)_ | -| --nut-calendar-title-font | _var(--nut-font-size-4)_ | -| --nut-calendar-title-font-weight | _500_ | -| --nut-calendar-sub-title-font | _var(--nut-font-size-2)_ | -| --nut-calendar-text-font | _var(--nut-font-size-1)_ | -| --nut-calendar-day-font | _16px_ | -| --nut-calendar-day-active-border-radius | _0px_ | -| --nut-calendar-day-font-weight | _500_ | -| --nut-calendar-day67-font-color | _var(--nut-primary-color)_ | -| --nut-calendar-month-title-font-size | _inherit_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-calendar-primary-color | _var(--nut-primary-color)_ | +| --nut-calendar-choose-color | _var(--nut-primary-color)_ | +| --nut-calendar-choose-font-color | _var(--nut-primary-color)_ | +| --nut-calendar-base-color | _#333333_ | +| --nut-calendar-disable-color | _#d1d0d0_ | +| --nut-calendar-base-font | _var(--nut-font-size-3)_ | +| --nut-calendar-title-font | _var(--nut-font-size-4)_ | +| --nut-calendar-title-font-weight | _500_ | +| --nut-calendar-sub-title-font | _var(--nut-font-size-2)_ | +| --nut-calendar-text-font | _var(--nut-font-size-1)_ | +| --nut-calendar-day-font | _16px_ | +| --nut-calendar-day-active-border-radius | _0px_ | +| --nut-calendar-day-font-weight | _500_ | +| --nut-calendar-day67-font-color | _var(--nut-primary-color)_ | +| --nut-calendar-month-title-font-size | _inherit_ | diff --git a/src/packages/__VUE/calendar/doc.taro.md b/src/packages/__VUE/calendar/doc.taro.md index 24d6ffe821..212953ad02 100644 --- a/src/packages/__VUE/calendar/doc.taro.md +++ b/src/packages/__VUE/calendar/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { Calendar } from '@nutui/nutui-taro'; @@ -18,18 +18,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -73,18 +63,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -137,18 +116,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -200,18 +168,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -265,46 +222,41 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -314,18 +266,18 @@ app.use(Calendar); :::demo -```html +```vue - ``` @@ -374,30 +316,34 @@ app.use(Calendar); :::demo -```html +```vue - diff --git a/src/packages/__VUE/cascader/doc.en-US.md b/src/packages/__VUE/cascader/doc.en-US.md index 231467edbe..165d82c98b 100644 --- a/src/packages/__VUE/cascader/doc.en-US.md +++ b/src/packages/__VUE/cascader/doc.en-US.md @@ -19,7 +19,7 @@ app.use(Cascader); Pass in the `options` list. :::demo -```html +```vue - ``` @@ -114,7 +104,7 @@ Pass in the `options` list. use `textKey`、`valueKey`、`childrenKey`Specify the property name. :::demo -```html +```vue - ``` @@ -190,7 +173,7 @@ use `textKey`、`valueKey`、`childrenKey`Specify the property name. Use `lazy` to identify whether data needs to be obtained dynamically. At this time, not transmitting `options` means that all data needs to be loaded through `lazyload` . The first loading is distinguished by the `root` attribute. When a non leaf node is encountered, the `lazyload` method will be called. The parameters are the current node and the `resolve` method. Note that the `resolve` method must be called. If it is not transmitted to a child node, it will be treated as a leaf node. :::demo -```html +```vue - ``` @@ -260,7 +237,7 @@ Use `lazy` to identify whether data needs to be obtained dynamically. At this ti :::demo -```html +```vue - ``` @@ -334,7 +305,7 @@ If your data is a flat structure that can be converted into a tree structure, yo :::demo -```html +```vue - ``` @@ -394,28 +359,28 @@ If your data is a flat structure that can be converted into a tree structure, yo ### Props -| Attribute | Description | Type | Default | -| ------------------- | ------------------------------------------------------------------------------------------------------------ | -------- | ------------- | -| v-model | Selected value, bidirectional binding | Array | - | -| v-model:visible | selected layer | boolean | `false` | -| options | Cascade data | Array | - | -| lazy | Whether to enable dynamic loading | boolean | - | -| lazy-load | Dynamic loading callback, which takes effect when dynamic loading is enabled | Function | - | -| value-key | Customize the field of `value` in the `options` structure | string | - | -| text-key | Customize the fields of `text` in the `options` structure | string | - | -| children-key | Customize the fields of `children` in the `options` structure | string | - | -| convert-config | When options is a flat structure that can be converted into a tree structure, configure the conversion rules | object | - | -| title | Title | string | `''` | -| close-icon-position | Cancel the button position and inherit the popup component | string | `"top-right"` | -| closeable | Whether to display the close button and inherit the popup component | boolean | `false` | -| poppable | Whether to display the popup(After setting to false, the title is invalid) | boolean | `true` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | Selected value, bidirectional binding | Array | - | +| v-model:visible | selected layer | boolean | `false` | +| options | Cascade data | Array | - | +| lazy | Whether to enable dynamic loading | boolean | - | +| lazy-load | Dynamic loading callback, which takes effect when dynamic loading is enabled | Function | - | +| value-key | Customize the field of `value` in the `options` structure | string | - | +| text-key | Customize the fields of `text` in the `options` structure | string | - | +| children-key | Customize the fields of `children` in the `options` structure | string | - | +| convert-config | When options is a flat structure that can be converted into a tree structure, configure the conversion rules | object | - | +| title | Title | string | `''` | +| close-icon-position | Cancel the button position and inherit the popup component | string | `"top-right"` | +| closeable | Whether to display the close button and inherit the popup component | boolean | `false` | +| poppable | Whether to display the popup(After setting to false, the title is invalid) | boolean | `true` | ### Events -| Event | Description | Arguments | -| ----------- | ----------------------------------------- | -------------------- | -| change | Triggered when the selected value changes | `(value, pathNodes)` | -| path-change | Triggered when the selected item changes | `(pathNodes) ` | +| Event | Description | Arguments | +| --- | --- | --- | +| change | Triggered when the selected value changes | `(value, pathNodes)` | +| path-change | Triggered when the selected item changes | `(pathNodes) ` | ## Theming @@ -423,16 +388,16 @@ If your data is a flat structure that can be converted into a tree structure, yo The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| -------------------------------- | -------------------------- | -| --nut-cascader-font-size | _var(--nut-font-size-2)_ | -| --nut-cascader-line-height | _22px_ | -| --nut-cascader-tabs-item-padding | _0 10px_ | -| --nut-cascader-bar-padding | _24px 20px 17px_ | -| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | -| --nut-cascader-bar-line-height | _20px_ | -| --nut-cascader-bar-color | _var(--nut-title-color)_ | -| --nut-cascader-item-padding | _10px 20px_ | -| --nut-cascader-item-color | _var(--nut-title-color)_ | -| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | +| Name | Default Value | +| --- | --- | +| --nut-cascader-font-size | _var(--nut-font-size-2)_ | +| --nut-cascader-line-height | _22px_ | +| --nut-cascader-tabs-item-padding | _0 10px_ | +| --nut-cascader-bar-padding | _24px 20px 17px_ | +| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | +| --nut-cascader-bar-line-height | _20px_ | +| --nut-cascader-bar-color | _var(--nut-title-color)_ | +| --nut-cascader-item-padding | _10px 20px_ | +| --nut-cascader-item-color | _var(--nut-title-color)_ | +| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | | --nut-cascader-item-active-color | _var(--nut-primary-color)_ | diff --git a/src/packages/__VUE/cascader/doc.md b/src/packages/__VUE/cascader/doc.md index 004cd74dc5..33e3392361 100644 --- a/src/packages/__VUE/cascader/doc.md +++ b/src/packages/__VUE/cascader/doc.md @@ -19,7 +19,7 @@ app.use(Cascader); 传入`options`列表。 :::demo -```html +```vue - ``` @@ -109,7 +99,7 @@ app.use(Cascader); 可通过`textKey`、`valueKey`、`childrenKey`指定属性名。 :::demo -```html +```vue - ``` @@ -180,7 +163,7 @@ app.use(Cascader); 使用`lazy`标识是否需要动态获取数据,此时不传`options`代表所有数据都需要通过`lazyLoad`加载,首次加载通过`root`属性区分,当遇到非叶子节点时会调用`lazyLoad`方法,参数为当前节点和`resolve`方法,注意`resolve`方法必须调用,不传子节点时会被当做叶子节点处理。 :::demo -```html +```vue - ``` @@ -245,7 +222,7 @@ app.use(Cascader); :::demo -```html +```vue - ``` @@ -314,7 +285,7 @@ app.use(Cascader); :::demo -```html +```vue - ``` @@ -369,28 +334,28 @@ app.use(Cascader); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------- | --------------------------------------------------------- | -------- | ------------- | -| v-model | 选中值,双向绑定 | Array | - | -| v-model:visible | 显示选择层 | boolean | `false` | -| options | 级联数据 | Array | - | -| lazy | 是否开启动态加载 | boolean | - | -| lazy-load | 动态加载回调,开启动态加载时生效 | Function | - | -| value-key | 自定义 `options` 结构中 `value` 的字段 | string | - | -| text-key | 自定义 `options` 结构中 `text` 的字段 | string | - | -| children-key | 自定义 `options` 结构中 `children` 的字段 | string | - | -| convert-config | 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则 | object | - | -| title | 标题 | string | `''` | -| close-icon-position | 取消按钮位置,继承 `Popup` 组件 | string | `"top-right"` | -| closeable | 是否显示关闭按钮,继承 `Popup` 组件 | boolean | `false` | -| poppable | 是否需要弹层展示(设置为 `false` 后,`title` 失效) | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 选中值,双向绑定 | Array | - | +| v-model:visible | 显示选择层 | boolean | `false` | +| options | 级联数据 | Array | - | +| lazy | 是否开启动态加载 | boolean | - | +| lazy-load | 动态加载回调,开启动态加载时生效 | Function | - | +| value-key | 自定义 `options` 结构中 `value` 的字段 | string | - | +| text-key | 自定义 `options` 结构中 `text` 的字段 | string | - | +| children-key | 自定义 `options` 结构中 `children` 的字段 | string | - | +| convert-config | 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则 | object | - | +| title | 标题 | string | `''` | +| close-icon-position | 取消按钮位置,继承 `Popup` 组件 | string | `"top-right"` | +| closeable | 是否显示关闭按钮,继承 `Popup` 组件 | boolean | `false` | +| poppable | 是否需要弹层展示(设置为 `false` 后,`title` 失效) | boolean | `true` | ### Events -| 事件名 | 说明 | 回调参数 | -| ----------- | ---------------- | -------------------- | -| change | 选中值改变时触发 | `(value, pathNodes)` | -| path-change | 选中项改变时触发 | `(pathNodes)` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| change | 选中值改变时触发 | `(value, pathNodes)` | +| path-change | 选中项改变时触发 | `(pathNodes)` | ## 主题定制 @@ -398,16 +363,16 @@ app.use(Cascader); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| -------------------------------- | -------------------------- | -| --nut-cascader-font-size | _var(--nut-font-size-2)_ | -| --nut-cascader-line-height | _22px_ | -| --nut-cascader-tabs-item-padding | _0 10px_ | -| --nut-cascader-bar-padding | _24px 20px 17px_ | -| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | -| --nut-cascader-bar-line-height | _20px_ | -| --nut-cascader-bar-color | _var(--nut-title-color)_ | -| --nut-cascader-item-padding | _10px 20px_ | -| --nut-cascader-item-color | _var(--nut-title-color)_ | -| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-cascader-font-size | _var(--nut-font-size-2)_ | +| --nut-cascader-line-height | _22px_ | +| --nut-cascader-tabs-item-padding | _0 10px_ | +| --nut-cascader-bar-padding | _24px 20px 17px_ | +| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | +| --nut-cascader-bar-line-height | _20px_ | +| --nut-cascader-bar-color | _var(--nut-title-color)_ | +| --nut-cascader-item-padding | _10px 20px_ | +| --nut-cascader-item-color | _var(--nut-title-color)_ | +| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | | --nut-cascader-item-active-color | _var(--nut-primary-color)_ | diff --git a/src/packages/__VUE/cascader/doc.taro.md b/src/packages/__VUE/cascader/doc.taro.md index ea2bbd3c24..b3ca19a8aa 100644 --- a/src/packages/__VUE/cascader/doc.taro.md +++ b/src/packages/__VUE/cascader/doc.taro.md @@ -19,7 +19,7 @@ app.use(Cascader); 传入`options`列表。 :::demo -```html +```vue - ``` @@ -109,7 +99,7 @@ app.use(Cascader); 可通过`textKey`、`valueKey`、`childrenKey`指定属性名。 :::demo -```html +```vue - ``` @@ -180,7 +163,7 @@ app.use(Cascader); 使用`lazy`标识是否需要动态获取数据,此时不传`options`代表所有数据都需要通过`lazyLoad`加载,首次加载通过`root`属性区分,当遇到非叶子节点时会调用`lazyLoad`方法,参数为当前节点和`resolve`方法,注意`resolve`方法必须调用,不传子节点时会被当做叶子节点处理。 :::demo -```html +```vue - ``` @@ -245,7 +222,7 @@ app.use(Cascader); :::demo -```html +```vue - ``` @@ -314,7 +285,7 @@ app.use(Cascader); :::demo -```html +```vue - ``` @@ -369,28 +334,28 @@ app.use(Cascader); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------- | --------------------------------------------------------- | -------- | ------------- | -| v-model | 选中值,双向绑定 | Array | - | -| v-model:visible | 显示选择层 | boolean | `false` | -| options | 级联数据 | Array | - | -| lazy | 是否开启动态加载 | boolean | - | -| lazy-load | 动态加载回调,开启动态加载时生效 | Function | - | -| value-key | 自定义 `options` 结构中 `value` 的字段 | string | - | -| text-key | 自定义 `options` 结构中 `text` 的字段 | string | - | -| children-key | 自定义 `options` 结构中 `children` 的字段 | string | - | -| convert-config | 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则 | object | - | -| title | 标题 | string | `''` | -| close-icon-position | 取消按钮位置,继承 `Popup` 组件 | string | `"top-right"` | -| closeable | 是否显示关闭按钮,继承 `Popup` 组件 | boolean | `false` | -| poppable | 是否需要弹层展示(设置为 `false` 后,`title` 失效) | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 选中值,双向绑定 | Array | - | +| v-model:visible | 显示选择层 | boolean | `false` | +| options | 级联数据 | Array | - | +| lazy | 是否开启动态加载 | boolean | - | +| lazy-load | 动态加载回调,开启动态加载时生效 | Function | - | +| value-key | 自定义 `options` 结构中 `value` 的字段 | string | - | +| text-key | 自定义 `options` 结构中 `text` 的字段 | string | - | +| children-key | 自定义 `options` 结构中 `children` 的字段 | string | - | +| convert-config | 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则 | object | - | +| title | 标题 | string | `''` | +| close-icon-position | 取消按钮位置,继承 `Popup` 组件 | string | `"top-right"` | +| closeable | 是否显示关闭按钮,继承 `Popup` 组件 | boolean | `false` | +| poppable | 是否需要弹层展示(设置为 `false` 后,`title` 失效) | boolean | `true` | ### Events -| 事件名 | 说明 | 回调参数 | -| ----------- | ---------------- | -------------------- | -| change | 选中值改变时触发 | `(value, pathNodes)` | -| path-change | 选中项改变时触发 | `(pathNodes) ` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| change | 选中值改变时触发 | `(value, pathNodes)` | +| path-change | 选中项改变时触发 | `(pathNodes)` | ## 主题定制 @@ -398,16 +363,16 @@ app.use(Cascader); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| -------------------------------- | -------------------------- | -| --nut-cascader-font-size | _var(--nut-font-size-2)_ | -| --nut-cascader-line-height | _22px_ | -| --nut-cascader-tabs-item-padding | _0 10px_ | -| --nut-cascader-bar-padding | _24px 20px 17px_ | -| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | -| --nut-cascader-bar-line-height | _20px_ | -| --nut-cascader-bar-color | _var(--nut-title-color)_ | -| --nut-cascader-item-padding | _10px 20px_ | -| --nut-cascader-item-color | _var(--nut-title-color)_ | -| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-cascader-font-size | _var(--nut-font-size-2)_ | +| --nut-cascader-line-height | _22px_ | +| --nut-cascader-tabs-item-padding | _0 10px_ | +| --nut-cascader-bar-padding | _24px 20px 17px_ | +| --nut-cascader-bar-font-size | _var(--nut-font-size-4)_ | +| --nut-cascader-bar-line-height | _20px_ | +| --nut-cascader-bar-color | _var(--nut-title-color)_ | +| --nut-cascader-item-padding | _10px 20px_ | +| --nut-cascader-item-color | _var(--nut-title-color)_ | +| --nut-cascader-item-font-size | _var(--nut-font-size-2)_ | | --nut-cascader-item-active-color | _var(--nut-primary-color)_ | diff --git a/src/packages/__VUE/checkbox/demo.vue b/src/packages/__VUE/checkbox/demo.vue index c48e3d3500..a984504d92 100644 --- a/src/packages/__VUE/checkbox/demo.vue +++ b/src/packages/__VUE/checkbox/demo.vue @@ -2,42 +2,42 @@
- + {{ translate('checkbox') }} - + {{ translate('checkbox') }} - + {{ translate('checkbox') }} - {{ translate('unselectDisable') }} + {{ translate('unselectDisable') }} - {{ translate('selectedDisable') }} + {{ translate('selectedDisable') }} - {{ translate('size') }}25 + {{ translate('size') }}25 - {{ translate('size') }} 10 + {{ translate('size') }} 10 - + {{ translate('icon') }} - ``` @@ -54,23 +46,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -80,23 +64,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -106,23 +82,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -134,7 +102,7 @@ Customize the icon through the slot, it is recommended to set the `icon` and `ch :::demo -```html +```vue - ``` @@ -165,26 +124,16 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -194,7 +143,7 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -228,7 +168,7 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -262,10 +193,10 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -318,7 +240,7 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -356,7 +269,7 @@ When the value changes, the `change` event will be triggered :::demo -```html +```vue - ``` @@ -412,50 +316,50 @@ When the value changes, the `change` event will be triggered ### Checkbox Props -| Attribute | Description | Type | Default | -| ------------- | -------------------------------------------------------------------------------------------------- | ---------------- | ------- | -| v-model | If selected | boolean | `false` | -| disabled | Disable selection | boolean | `false` | -| text-position | The position of the text, optional value:`left`,`right` | string | `right` | -| icon-size | [Icon Size](#/en-US/icon) | string \| number | `18` | -| label | Text content of the check box | string | - | -| indeterminate | Whether half selection status is currently supported. It is generally used in select all operation | boolean | `false` | -| shape | Shape, optional values:`button`、`round` | String | `round` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | If selected | boolean | `false` | +| disabled | Disable selection | boolean | `false` | +| text-position | The position of the text, optional value:`left`,`right` | string | `right` | +| icon-size | [Icon Size](#/en-US/icon) | string \| number | `18` | +| label | Text content of the check box | string | - | +| indeterminate | Whether half selection status is currently supported. It is generally used in select all operation | boolean | `false` | +| shape | Shape, optional values:`button`、`round` | String | `round` | ### Checkbox Slots -| Name | Description | -| ------------- | ----------------------- | -| icon | Icon when not selected | -| checkedIcon | Icon when selected | +| Name | Description | +| --- | --- | +| icon | Icon when not selected | +| checkedIcon | Icon when selected | | indeterminate | Icon when half selected | ### CheckboxGroup Props -| Attribute | Description | Type | Default | -| --------- | ----------------------------------------------------------------------------------------------------------------------- | ------- | ------- | -| v-model | Identifier of the currently selected item, corresponding to `label` | Array | - | -| disabled | Whether to disable the selection, which will be used for all check boxes under it | boolean | `false` | -| max | Limit the number of choices. It cannot be used with select all / cancel / invert selection. `0 'means there is no limit | number | `0` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | Identifier of the currently selected item, corresponding to `label` | Array | - | +| disabled | Whether to disable the selection, which will be used for all check boxes under it | boolean | `false` | +| max | Limit the number of choices. It cannot be used with select all / cancel / invert selection. `0 'means there is no limit | number | `0` | ### Checkbox Events -| Event | Description | Arguments | -| ------ | -------------------------------- | --------------------------------------------------------------------------------------------------- | +| Event | Description | Arguments | +| --- | --- | --- | | change | Triggered when the value changes | (state, label),`state` represents the current state,`label` indicates the currently selected value | ### CheckboxGroup Events -| Event | Description | Arguments | -| ------ | -------------------------------- | -------------------------------------------------------------------------------------- | +| Event | Description | Arguments | +| --- | --- | --- | | change | Triggered when the value changes | label,`label` returns an array representing the collection of currently selected items | ### CheckboxGroup Methods -| methodName | Description | Arguments | -| ------------- | ------------------- | -------------------------------------------------- | -| toggleAll | Select all / cancel | `true`,to select all,`false`,cancel the selection | -| toggleReverse | Reverse selection | - | +| methodName | Description | Arguments | +| --- | --- | --- | +| toggleAll | Select all / cancel | `true`,to select all,`false`,cancel the selection | +| toggleReverse | Reverse selection | - | ## Theming @@ -463,22 +367,22 @@ When the value changes, the `change` event will be triggered The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| ----------------------------------------- | -------------------------- | -| --nut-checkbox-label-color | _#1d1e1e_ | -| --nut-checkbox-label-disable-color | _#999_ | -| --nut-checkbox-icon-disable-color | _#d6d6d6_ | -| --nut-checkbox-label-margin-left | _15px_ | -| --nut-checkbox-label-font-size | _14px_ | -| --nut-checkbox-icon-font-size | _18px_ | -| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | -| --nut-checkbox-button-padding | _5px 18px_ | -| --nut-checkbox-button-font-size | _12px_ | -| --nut-checkbox-button-border-radius | _15px_ | -| --nut-checkbox-button-border-color | _#f6f7f9_ | -| --nut-checkbox-button-background | _#f6f7f9_ | -| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | +| Name | Default Value | +| --- | --- | +| --nut-checkbox-label-color | _#1d1e1e_ | +| --nut-checkbox-label-disable-color | _#999_ | +| --nut-checkbox-icon-disable-color | _#d6d6d6_ | +| --nut-checkbox-label-margin-left | _15px_ | +| --nut-checkbox-label-font-size | _14px_ | +| --nut-checkbox-icon-font-size | _18px_ | +| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-checkbox-button-padding | _5px 18px_ | +| --nut-checkbox-button-font-size | _12px_ | +| --nut-checkbox-button-border-radius | _15px_ | +| --nut-checkbox-button-border-color | _#f6f7f9_ | +| --nut-checkbox-button-background | _#f6f7f9_ | +| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | | --nut-checkbox-button-border-color-active | _var(--nut-primary-color)_ | -| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | -| --nut-checkbox-display | _inline-flex_ | -| --nut-checkbox-margin-right | _20px_ | +| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | +| --nut-checkbox-display | _inline-flex_ | +| --nut-checkbox-margin-right | _20px_ | diff --git a/src/packages/__VUE/checkbox/doc.md b/src/packages/__VUE/checkbox/doc.md index a1937fbfaa..6a78832394 100644 --- a/src/packages/__VUE/checkbox/doc.md +++ b/src/packages/__VUE/checkbox/doc.md @@ -6,7 +6,7 @@ ### 安装 -```ts +```js import { createApp } from 'vue'; import { Checkbox, CheckboxGroup } from '@nutui/nutui'; @@ -19,32 +19,24 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -54,23 +46,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -80,23 +64,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -106,23 +82,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -134,7 +102,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -165,26 +124,16 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -194,7 +143,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -228,7 +168,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -262,53 +193,46 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -318,7 +242,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -356,13 +271,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -412,50 +320,50 @@ app.use(CheckboxGroup); ### Checkbox Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ---------------------------------------- | ---------------- | ------- | -| v-model | 是否处于选中状态 | boolean | `false` | -| disabled | 是否禁用选择 | boolean | `false` | -| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | -| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | -| label | 复选框的文本内容 | string | - | -| indeterminate | 当前是否支持半选状态,一般用在全选操作中 | boolean | `false` | -| shape | 形状,可选值:`button`、`round` | String | `round` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 是否处于选中状态 | boolean | `false` | +| disabled | 是否禁用选择 | boolean | `false` | +| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | +| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | +| label | 复选框的文本内容 | string | - | +| indeterminate | 当前是否支持半选状态,一般用在全选操作中 | boolean | `false` | +| shape | 形状,可选值:`button`、`round` | String | `round` | ### Checkbox Slots -| 名称 | 说明 | -| ------------- | -------------- | -| icon | 未选中时的图标 | -| checkedIcon | 选中时的图标 | -| indeterminate | 半选时的图标 | +| 名称 | 说明 | +| --- | --- | +| icon | 未选中时的图标 | +| checkedIcon | 选中时的图标 | +| indeterminate | 半选时的图标 | ### CheckboxGroup Props -| 参数 | 说明 | 类型 | 默认值 | -| -------- | --------------------------------------------------------------- | ------- | ------- | -| v-model | 当前选中项的标识符,和 `label` 相对应 | Array | - | -| disabled | 是否禁用选择,将用于其下的全部复选框 | boolean | `false` | -| max | 限制选择的数量,不能和`全选/取消/反选`一起使用, `0`表示没有限制 | number | `0` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前选中项的标识符,和 `label` 相对应 | Array | - | +| disabled | 是否禁用选择,将用于其下的全部复选框 | boolean | `false` | +| max | 限制选择的数量,不能和`全选/取消/反选`一起使用, `0`表示没有限制 | number | `0` | ### Checkbox Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | -------------------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | (state, label), `state` 代表当前状态,`label` 表示当前选中的值 | ### CheckboxGroup Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | -------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | `label`,`label` 返回一个数组,表示当前选中项的集合 | ### CheckboxGroup Methods -| 方法名 | 说明 | 参数 | -| ------------- | --------- | ------------------------------------------- | -| toggleAll | 全选/取消 | 传 `true`,表示全选,传 `false`,表示取消全选 | -| toggleReverse | 反选 | - | +| 方法名 | 说明 | 参数 | +| --- | --- | --- | +| toggleAll | 全选/取消 | 传 `true`,表示全选,传 `false`,表示取消全选 | +| toggleReverse | 反选 | - | ## 主题定制 @@ -463,22 +371,22 @@ app.use(CheckboxGroup); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ----------------------------------------- | -------------------------- | -| --nut-checkbox-label-color | _#1d1e1e_ | -| --nut-checkbox-label-disable-color | _#999_ | -| --nut-checkbox-icon-disable-color | _#d6d6d6_ | -| --nut-checkbox-label-margin-left | _15px_ | -| --nut-checkbox-label-font-size | _14px_ | -| --nut-checkbox-icon-font-size | _18px_ | -| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | -| --nut-checkbox-button-padding | _5px 18px_ | -| --nut-checkbox-button-font-size | _12px_ | -| --nut-checkbox-button-border-radius | _15px_ | -| --nut-checkbox-button-border-color | _#f6f7f9_ | -| --nut-checkbox-button-background | _#f6f7f9_ | -| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-checkbox-label-color | _#1d1e1e_ | +| --nut-checkbox-label-disable-color | _#999_ | +| --nut-checkbox-icon-disable-color | _#d6d6d6_ | +| --nut-checkbox-label-margin-left | _15px_ | +| --nut-checkbox-label-font-size | _14px_ | +| --nut-checkbox-icon-font-size | _18px_ | +| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-checkbox-button-padding | _5px 18px_ | +| --nut-checkbox-button-font-size | _12px_ | +| --nut-checkbox-button-border-radius | _15px_ | +| --nut-checkbox-button-border-color | _#f6f7f9_ | +| --nut-checkbox-button-background | _#f6f7f9_ | +| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | | --nut-checkbox-button-border-color-active | _var(--nut-primary-color)_ | -| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | -| --nut-checkbox-display | _inline-flex_ | -| --nut-checkbox-margin-right | _20px_ | +| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | +| --nut-checkbox-display | _inline-flex_ | +| --nut-checkbox-margin-right | _20px_ | diff --git a/src/packages/__VUE/checkbox/doc.taro.md b/src/packages/__VUE/checkbox/doc.taro.md index 54612fe3d8..9be9b92b04 100644 --- a/src/packages/__VUE/checkbox/doc.taro.md +++ b/src/packages/__VUE/checkbox/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```ts +```js import { createApp } from 'vue'; import { Checkbox, CheckboxGroup } from '@nutui/nutui-taro'; @@ -19,32 +19,24 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -54,23 +46,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -80,23 +64,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -106,23 +82,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -134,7 +102,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -165,24 +124,16 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -192,7 +143,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - +``` + +::: + +### checkboxGroup 禁用 + +:::demo + +```vue + + ``` @@ -226,51 +193,46 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -280,7 +242,7 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -318,13 +271,15 @@ app.use(CheckboxGroup); :::demo -```html +```vue - ``` @@ -372,50 +320,50 @@ app.use(CheckboxGroup); ### Checkbox Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ---------------------------------------- | ---------------- | ------- | -| v-model | 是否处于选中状态 | boolean | `false` | -| disabled | 是否禁用选择 | boolean | `false` | -| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | -| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | -| label | 复选框的文本内容 | string | - | -| indeterminate | 当前是否支持半选状态,一般用在全选操作中 | boolean | `false` | -| shape | 形状,可选值:`button`、`round` | String | `round` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 是否处于选中状态 | boolean | `false` | +| disabled | 是否禁用选择 | boolean | `false` | +| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | +| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | +| label | 复选框的文本内容 | string | - | +| indeterminate | 当前是否支持半选状态,一般用在全选操作中 | boolean | `false` | +| shape | 形状,可选值:`button`、`round` | String | `round` | ### Checkbox Slots -| 名称 | 说明 | -| ------------- | -------------- | -| icon | 未选中时的图标 | -| checkedIcon | 选中时的图标 | -| indeterminate | 半选时的图标 | +| 名称 | 说明 | +| --- | --- | +| icon | 未选中时的图标 | +| checkedIcon | 选中时的图标 | +| indeterminate | 半选时的图标 | ### CheckboxGroup Props -| 参数 | 说明 | 类型 | 默认值 | -| -------- | --------------------------------------------------------------- | ------- | ------- | -| v-model | 当前选中项的标识符,和 `label` 相对应 | Array | - | -| disabled | 是否禁用选择,将用于其下的全部复选框 | boolean | `false` | -| max | 限制选择的数量,不能和`全选/取消/反选`一起使用, `0`表示没有限制 | number | `0` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前选中项的标识符,和 `label` 相对应 | Array | - | +| disabled | 是否禁用选择,将用于其下的全部复选框 | boolean | `false` | +| max | 限制选择的数量,不能和`全选/取消/反选`一起使用, `0`表示没有限制 | number | `0` | ### Checkbox Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | -------------------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | (state, label), `state` 代表当前状态,`label` 表示当前选中的值 | ### CheckboxGroup Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | -------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | `label`,`label` 返回一个数组,表示当前选中项的集合 | ### CheckboxGroup Methods -| 方法名 | 说明 | 参数 | -| ------------- | --------- | ------------------------------------------- | -| toggleAll | 全选/取消 | 传 `true`,表示全选,传 `false`,表示取消全选 | -| toggleReverse | 反选 | - | +| 方法名 | 说明 | 参数 | +| --- | --- | --- | +| toggleAll | 全选/取消 | 传 `true`,表示全选,传 `false`,表示取消全选 | +| toggleReverse | 反选 | - | ## 主题定制 @@ -423,22 +371,22 @@ app.use(CheckboxGroup); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | 描述 | -| ----------------------------------------- | -------------------------- | ---- | -| --nut-checkbox-label-color | _#1d1e1e_ | - | -| --nut-checkbox-label-disable-color | _#999_ | - | -| --nut-checkbox-icon-disable-color | _#d6d6d6_ | - | -| --nut-checkbox-label-margin-left | _15px_ | - | -| --nut-checkbox-label-font-size | _14px_ | - | -| --nut-checkbox-icon-font-size | _18px_ | - | -| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | - | -| --nut-checkbox-button-padding | _5px 18px_ | -| --nut-checkbox-button-font-size | _12px_ | -| --nut-checkbox-button-border-radius | _15px_ | -| --nut-checkbox-button-border-color | _#f6f7f9_ | -| --nut-checkbox-button-background | _#f6f7f9_ | -| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-checkbox-label-color | _#1d1e1e_ | +| --nut-checkbox-label-disable-color | _#999_ | +| --nut-checkbox-icon-disable-color | _#d6d6d6_ | +| --nut-checkbox-label-margin-left | _15px_ | +| --nut-checkbox-label-font-size | _14px_ | +| --nut-checkbox-icon-font-size | _18px_ | +| --nut-checkbox-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-checkbox-button-padding | _5px 18px_ | +| --nut-checkbox-button-font-size | _12px_ | +| --nut-checkbox-button-border-radius | _15px_ | +| --nut-checkbox-button-border-color | _#f6f7f9_ | +| --nut-checkbox-button-background | _#f6f7f9_ | +| --nut-checkbox-button-font-color-active | _var(--nut-primary-color)_ | | --nut-checkbox-button-border-color-active | _var(--nut-primary-color)_ | -| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | -| --nut-checkbox-display | _inline-flex_ | -| --nut-checkbox-margin-right | _20px_ | +| --nut-checkbox-button-background-active | _var(--nut-primary-color)_ | +| --nut-checkbox-display | _inline-flex_ | +| --nut-checkbox-margin-right | _20px_ | diff --git a/src/packages/__VUE/datepicker/demo.vue b/src/packages/__VUE/datepicker/demo.vue index a2ef8ef3b6..38610e5676 100644 --- a/src/packages/__VUE/datepicker/demo.vue +++ b/src/packages/__VUE/datepicker/demo.vue @@ -3,7 +3,7 @@

{{ translate('basic') }}

{{ translate('mmdd') }} {{ translate('filter') }} - - diff --git a/src/packages/__VUE/datepicker/doc.en-US.md b/src/packages/__VUE/datepicker/doc.en-US.md index fa0fc9e232..fe55e758b0 100644 --- a/src/packages/__VUE/datepicker/doc.en-US.md +++ b/src/packages/__VUE/datepicker/doc.en-US.md @@ -6,7 +6,7 @@ Used to select time, support date and time dimensions, usually used with the Pop ### Install -```javascript +```js import { createApp } from 'vue'; import { DatePicker } from '@nutui/nutui'; @@ -18,7 +18,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -59,7 +48,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -113,7 +89,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -150,7 +117,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -190,7 +147,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -228,7 +174,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -266,7 +203,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -335,7 +261,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -373,7 +290,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -441,48 +347,48 @@ app.use(DatePicker); ### Props -| Attribute | Description | Type | Default | -| ------------------ | --------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------- | -| v-model | Default Date | date | `null` | -| type | Can be set to `date` `time` `year-month` `month-day` `datehour` `hour-minute`(`v4.0.5`) | string | `date` | -| minute-step | Option minute step | number | `1` | -| is-show-chinese | Show Chinese | boolean | `false` | -| min-date | Start date | date | `Ten years ago on January 1` | -| max-date | End date | date | `Ten years later on December 31` | -| formatter | Option text formatter | (type: string, option: PickerOption) => PickerOption | | -| filter | Option filter | (type: string, option: PickerOption) => PickerOption[] | | -| title | Title | string | `null` | -| ok-text | Text of confirm button | string | `confirm` | -| cancel-text | Text of cancel button | string | `cancel` | -| three-dimensional | Turn on 3D effects | boolean | `true` | -| swipe-duration | Duration of the momentum animation | number \| string | `1000` | -| visible-option-num | Count of visible columns | number \| string | `7` | -| option-height | Option height | number \| string | `36` | -| show-toolbar | Whether to show toolbar | boolean | `true` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | Default Date | date | `null` | +| type | Can be set to `date` `time` `year-month` `month-day` `datehour` `hour-minute`(`v4.0.5`) | string | `date` | +| minute-step | Option minute step | number | `1` | +| is-show-chinese | Show Chinese | boolean | `false` | +| min-date | Start date | date | `Ten years ago on January 1` | +| max-date | End date | date | `Ten years later on December 31` | +| formatter | Option text formatter | (type: string, option: PickerOption) => PickerOption | | +| filter | Option filter | (type: string, option: PickerOption) => PickerOption[] | | +| title | Title | string | `null` | +| ok-text | Text of confirm button | string | `confirm` | +| cancel-text | Text of cancel button | string | `cancel` | +| three-dimensional | Turn on 3D effects | boolean | `true` | +| swipe-duration | Duration of the momentum animation | number \| string | `1000` | +| visible-option-num | Count of visible columns | number \| string | `7` | +| option-height | Option height | number \| string | `36` | +| show-toolbar | Whether to show toolbar | boolean | `true` | ### Events -| Event | Description | Arguments | -| ------- | ------------------------------------ | ------------------------------------------------- | -| confirm | Emitted when click confirm button. | `{ selectedValue, selectedOptions }` | -| cancel | Emitted when click cancel button. | `{ selectedValue, selectedOptions }` | -| change | Emitted when current option changed. | `{ columnIndex, selectedValue, selectedOptions }` | +| Event | Description | Arguments | +| --- | --- | --- | +| confirm | Emitted when click confirm button. | `{ selectedValue, selectedOptions }` | +| cancel | Emitted when click cancel button. | `{ selectedValue, selectedOptions }` | +| change | Emitted when current option changed. | `{ columnIndex, selectedValue, selectedOptions }` | ### Slots -| Name | Description | -| ------- | ----------------------------- | +| Name | Description | +| --- | --- | | default | Custom content bottom columns | -| top | Custom content top columns | +| top | Custom content top columns | ### Data Structure of PickerOption -| Key | Description | Type | Default | -| --------- | --------------- | ---------------- | ------- | -| text | Text of column | string \| number | - | -| value | Value of column | string \| number | - | -| children | Cascader Option | Array | - | -| className | Extra CalssName | string | - | +| Key | Description | Type | Default | +| --- | --- | --- | --- | +| text | Text of column | string \| number | - | +| value | Value of column | string \| number | - | +| children | Cascader Option | Array | - | +| className | Extra CalssName | string | - | ## Theming @@ -490,17 +396,17 @@ app.use(DatePicker); The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| ------------------------------------ | -------------------------- | -| --nut-picker-cancel-color | _#808080_ | -| --nut-picker-ok-color | _var(--nut-primary-color)_ | -| --nut-picker-bar-cancel-font-size | _14px_ | -| --nut-picker-bar-ok-font-size | _14px_ | -| --nut-picker-bar-button-padding | _0 15px_ | -| --nut-picker-bar-title-font-size | _16px_ | -| --nut-picker-bar-title-color | _var(--nut-title-color)_ | -| --nut-picker-bar-title-font-weight | _normal_ | -| --nut-picker-item-height | _36px_ | -| --nut-picker-item-text-color | _var(--nut-title-color)_ | -| --nut-picker-item-text-font-size | _14px_ | -| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | +| Name | Default Value | +| --- | --- | +| --nut-picker-cancel-color | _#808080_ | +| --nut-picker-ok-color | _var(--nut-primary-color)_ | +| --nut-picker-bar-cancel-font-size | _14px_ | +| --nut-picker-bar-ok-font-size | _14px_ | +| --nut-picker-bar-button-padding | _0 15px_ | +| --nut-picker-bar-title-font-size | _16px_ | +| --nut-picker-bar-title-color | _var(--nut-title-color)_ | +| --nut-picker-bar-title-font-weight | _normal_ | +| --nut-picker-item-height | _36px_ | +| --nut-picker-item-text-color | _var(--nut-title-color)_ | +| --nut-picker-item-text-font-size | _14px_ | +| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | diff --git a/src/packages/__VUE/datepicker/doc.md b/src/packages/__VUE/datepicker/doc.md index f25a112b83..13d59a483c 100644 --- a/src/packages/__VUE/datepicker/doc.md +++ b/src/packages/__VUE/datepicker/doc.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { DatePicker } from '@nutui/nutui'; @@ -18,7 +18,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -59,7 +48,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -115,7 +91,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -154,7 +121,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -193,7 +151,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -231,7 +178,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -271,7 +209,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -339,7 +267,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -379,7 +298,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -447,48 +355,48 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | -------- | -| v-model | 初始值 | date | `null` | -| type | 时间类型,可选值 `date`(年月日) `time`(时分秒) `year-month`(年月) `month-day`(月日) `datehour`(年月日时) `hour-minute`(时分`v4.0.5`) | string | `date` | -| minute-step | 分钟步进值 | number | `1` | -| is-show-chinese | 每列是否展示中文 | boolean | `false` | -| min-date | 开始日期 | date | `十年前` | -| max-date | 结束日期 | date | `十年后` | -| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | | -| filter | 选项过滤函数 | (type: string, option: PickerOption) => PickerOption[] | | -| title | 设置标题 | string | `null` | -| ok-text | 确定按钮文案 | string | `确定` | -| cancel-text | 取消按钮文案 | string | `取消` | -| three-dimensional | 是否开启 3D 效果 | boolean | `true` | -| swipe-duration | 惯性滚动时长 | number \| string | `1000` | -| visible-option-num | 可见的选项个数 | number \| string | `7` | -| option-height | 选项高度 | number \| string | `36` | -| show-toolbar | 是否显示顶部导航 | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 初始值 | date | `null` | +| type | 时间类型,可选值 `date`(年月日) `time`(时分秒) `year-month`(年月) `month-day`(月日) `datehour`(年月日时) `hour-minute`(时分`v4.0.5`) | string | `date` | +| minute-step | 分钟步进值 | number | `1` | +| is-show-chinese | 每列是否展示中文 | boolean | `false` | +| min-date | 开始日期 | date | `十年前` | +| max-date | 结束日期 | date | `十年后` | +| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | | +| filter | 选项过滤函数 | (type: string, option: PickerOption) => PickerOption[] | | +| title | 设置标题 | string | `null` | +| ok-text | 确定按钮文案 | string | `确定` | +| cancel-text | 取消按钮文案 | string | `取消` | +| three-dimensional | 是否开启 3D 效果 | boolean | `true` | +| swipe-duration | 惯性滚动时长 | number \| string | `1000` | +| visible-option-num | 可见的选项个数 | number \| string | `7` | +| option-height | 选项高度 | number \| string | `36` | +| show-toolbar | 是否显示顶部导航 | boolean | `true` | ### Events -| 事件名 | 说明 | 回调参数 | -| ------- | ------------------ | ------------------------------------------------- | -| confirm | 点击确定按钮时触发 | `{ selectedValue, selectedOptions }` | -| cancel | 点击取消按钮时触发 | `{ selectedValue, selectedOptions }` | -| change | 选项改变时触发 | `{ columnIndex, selectedValue, selectedOptions }` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| confirm | 点击确定按钮时触发 | `{ selectedValue, selectedOptions }` | +| cancel | 点击取消按钮时触发 | `{ selectedValue, selectedOptions }` | +| change | 选项改变时触发 | `{ columnIndex, selectedValue, selectedOptions }` | ### Slots -| 名称 | 说明 | -| ------- | ---------------------- | +| 名称 | 说明 | +| --- | --- | | default | 自定义滑动数据底部区域 | -| top | 自定义滑动数据顶部区域 | +| top | 自定义滑动数据顶部区域 | ### PickerOption 数据结构 -| 键名 | 说明 | 类型 | 默认值 | -| --------- | -------------------- | ---------------- | ------ | -| text | 选项的文字内容 | string \| number | - | -| value | 选项对应的值,且唯一 | string \| number | - | -| children | 用于级联选项 | Array | - | -| className | 添加额外的类名 | string | - | +| 键名 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| text | 选项的文字内容 | string \| number | - | +| value | 选项对应的值,且唯一 | string \| number | - | +| children | 用于级联选项 | Array | - | +| className | 添加额外的类名 | string | - | ## 主题定制 @@ -496,17 +404,17 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------ | -------------------------- | -| --nut-picker-cancel-color | _#808080_ | -| --nut-picker-ok-color | _var(--nut-primary-color)_ | -| --nut-picker-bar-cancel-font-size | _14px_ | -| --nut-picker-bar-ok-font-size | _14px_ | -| --nut-picker-bar-button-padding | _0 15px_ | -| --nut-picker-bar-title-font-size | _16px_ | -| --nut-picker-bar-title-color | _var(--nut-title-color)_ | -| --nut-picker-bar-title-font-weight | _normal_ | -| --nut-picker-item-height | _36px_ | -| --nut-picker-item-text-color | _var(--nut-title-color)_ | -| --nut-picker-item-text-font-size | _14px_ | -| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-picker-cancel-color | _#808080_ | +| --nut-picker-ok-color | _var(--nut-primary-color)_ | +| --nut-picker-bar-cancel-font-size | _14px_ | +| --nut-picker-bar-ok-font-size | _14px_ | +| --nut-picker-bar-button-padding | _0 15px_ | +| --nut-picker-bar-title-font-size | _16px_ | +| --nut-picker-bar-title-color | _var(--nut-title-color)_ | +| --nut-picker-bar-title-font-weight | _normal_ | +| --nut-picker-item-height | _36px_ | +| --nut-picker-item-text-color | _var(--nut-title-color)_ | +| --nut-picker-item-text-font-size | _14px_ | +| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | diff --git a/src/packages/__VUE/datepicker/doc.taro.md b/src/packages/__VUE/datepicker/doc.taro.md index 23da9e7cb3..eb95f9f099 100644 --- a/src/packages/__VUE/datepicker/doc.taro.md +++ b/src/packages/__VUE/datepicker/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { DatePicker } from '@nutui/nutui-taro'; @@ -18,7 +18,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -60,7 +46,7 @@ app.use(DatePicker); :::demo -```html +```vue - ``` @@ -115,7 +88,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -156,7 +117,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -198,7 +146,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -238,7 +172,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -280,7 +202,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -350,7 +259,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -392,7 +289,7 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t :::demo -```html +```vue - ``` @@ -462,47 +345,47 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | -------- | -| v-model | 初始值 | date | `null` | -| type | 时间类型,可选值 `date`(年月日) `time`(时分秒) `year-month`(年月) `month-day`(月日) `datehour`(年月日时) `hour-minute`(时分`v4.0.5`) | string | `date` | -| minute-step | 分钟步进值 | number | `1` | -| is-show-chinese | 每列是否展示中文 | boolean | `false` | -| min-date | 开始日期 | date | `十年前` | -| max-date | 结束日期 | date | `十年后` | -| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | | -| filter | 选项过滤函数 | (type: string, option: PickerOption) => PickerOption[] | | -| title | 设置标题 | string | `null` | -| ok-text | 确定按钮文案 | string | `确定` | -| cancel-text | 取消按钮文案 | string | `取消` | -| swipe-duration | 惯性滚动时长 | number \| string | `1000` | -| visible-option-num | 可见的选项个数 | number \| string | `7` | -| option-height | 选项高度 | number \| string | `36` | -| show-toolbar | 是否显示顶部导航 | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 初始值 | date | `null` | +| type | 时间类型,可选值 `date`(年月日) `time`(时分秒) `year-month`(年月) `month-day`(月日) `datehour`(年月日时) `hour-minute`(时分`v4.0.5`) | string | `date` | +| minute-step | 分钟步进值 | number | `1` | +| is-show-chinese | 每列是否展示中文 | boolean | `false` | +| min-date | 开始日期 | date | `十年前` | +| max-date | 结束日期 | date | `十年后` | +| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | | +| filter | 选项过滤函数 | (type: string, option: PickerOption) => PickerOption[] | | +| title | 设置标题 | string | `null` | +| ok-text | 确定按钮文案 | string | `确定` | +| cancel-text | 取消按钮文案 | string | `取消` | +| swipe-duration | 惯性滚动时长 | number \| string | `1000` | +| visible-option-num | 可见的选项个数 | number \| string | `7` | +| option-height | 选项高度 | number \| string | `36` | +| show-toolbar | 是否显示顶部导航 | boolean | `true` | ### Events -| 事件名 | 说明 | 回调参数 | -| ------- | ------------------ | ------------------------------------------------- | -| confirm | 点击确定按钮时触发 | `{ selectedValue, selectedOptions }` | -| cancel | 点击取消按钮时触发 | `{ selectedValue, selectedOptions }` | -| change | 选项改变时触发 | `{ columnIndex, selectedValue, selectedOptions }` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| confirm | 点击确定按钮时触发 | `{ selectedValue, selectedOptions }` | +| cancel | 点击取消按钮时触发 | `{ selectedValue, selectedOptions }` | +| change | 选项改变时触发 | `{ columnIndex, selectedValue, selectedOptions }` | ### Slots -| 名称 | 说明 | -| ------- | ---------------------- | +| 名称 | 说明 | +| --- | --- | | default | 自定义滑动数据底部区域 | -| top | 自定义滑动数据顶部区域 | +| top | 自定义滑动数据顶部区域 | ### PickerOption 数据结构 -| 键名 | 说明 | 类型 | 默认值 | -| --------- | -------------------- | ---------------- | ------ | -| text | 选项的文字内容 | string \| number | - | -| value | 选项对应的值,且唯一 | string \| number | - | -| children | 用于级联选项 | Array | - | -| className | 添加额外的类名 | string | - | +| 键名 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| text | 选项的文字内容 | string \| number | - | +| value | 选项对应的值,且唯一 | string \| number | - | +| children | 用于级联选项 | Array | - | +| className | 添加额外的类名 | string | - | ## 主题定制 @@ -510,17 +393,17 @@ DatetimePicker 通过 `type` 属性来定义需要选择的时间类型。将 `t 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------ | -------------------------- | -| --nut-picker-cancel-color | _#808080_ | -| --nut-picker-ok-color | _var(--nut-primary-color)_ | -| --nut-picker-bar-cancel-font-size | _14px_ | -| --nut-picker-bar-ok-font-size | _14px_ | -| --nut-picker-bar-button-padding | _0 15px_ | -| --nut-picker-bar-title-font-size | _16px_ | -| --nut-picker-bar-title-color | _var(--nut-title-color)_ | -| --nut-picker-bar-title-font-weight | _normal_ | -| --nut-picker-item-height | _36px_ | -| --nut-picker-item-text-color | _var(--nut-title-color)_ | -| --nut-picker-item-text-font-size | _14px_ | -| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-picker-cancel-color | _#808080_ | +| --nut-picker-ok-color | _var(--nut-primary-color)_ | +| --nut-picker-bar-cancel-font-size | _14px_ | +| --nut-picker-bar-ok-font-size | _14px_ | +| --nut-picker-bar-button-padding | _0 15px_ | +| --nut-picker-bar-title-font-size | _16px_ | +| --nut-picker-bar-title-color | _var(--nut-title-color)_ | +| --nut-picker-bar-title-font-weight | _normal_ | +| --nut-picker-item-height | _36px_ | +| --nut-picker-item-text-color | _var(--nut-title-color)_ | +| --nut-picker-item-text-font-size | _14px_ | +| --nut-picker-item-active-line-border | _1px solid #d8d8d8_ | diff --git a/src/packages/__VUE/form/demo.vue b/src/packages/__VUE/form/demo.vue index 8fd16aaf48..71f347c8ed 100644 --- a/src/packages/__VUE/form/demo.vue +++ b/src/packages/__VUE/form/demo.vue @@ -190,9 +190,9 @@
- diff --git a/src/packages/__VUE/form/doc.en-US.md b/src/packages/__VUE/form/doc.en-US.md index ba483749e8..b411cf118f 100644 --- a/src/packages/__VUE/form/doc.en-US.md +++ b/src/packages/__VUE/form/doc.en-US.md @@ -6,7 +6,7 @@ It is used for data entry and verification. It supports input box, radio box, ch ### Install -```javascript +```js import { createApp } from 'vue'; import { Form, FormItem } from '@nutui/nutui'; @@ -19,7 +19,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -61,7 +56,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -153,14 +138,18 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -293,7 +287,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -430,50 +419,50 @@ app.use(FormItem); ### Form Props -| Attribute | Description | Type | Default | -| ----------- | -------------------------------------------------------- | ------------------------ | ------- | -| model-value | Form data object (required when using form verification) | object | | -| rules | Unified configuration FormItem attr rules | { prop: FormItemRule[] } | `{}` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| model-value | Form data object (required when using form verification) | object | | +| rules | Unified configuration FormItem attr rules | { prop: FormItemRule[] } | `{}` | ### Form Events -| Event | Description | Arguments | -| -------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| Event | Description | Arguments | +| --- | --- | --- | | validate | Triggered after any single table item fails to be verified | The `prop` value of the form item to be verified, whether the verification is passed, and the error message (if any) | ### FormItem Props -| Attribute | Description | Type | Default | -| ------------------- | ------------------------------------------------------------------------------------------- | ---------------- | ------- | -| required | Whether to display the red asterisk next to the label of the required field | boolean | `false` | -| prop | The v-model field of the form field is required when the form verification function is used | string | - | -| rules | Define validation rules | FormItemRule [] | [] | -| label-width | The width of the form item label. The default unit is `px` | number \| string | `90` | -| label-align | Form item label alignment. The optional values are `center` `right` | string | `left` | -| body-align | Default Solt box alignment. The optional values are `center` `right` | string | `left` | -| error-message-align | Error prompt text alignment. The optional values are `center` and `right` | string | `left` | -| show-error-line | Whether to mark the input box in red when the verification fails | boolean | `true` | -| show-error-message | Whether to display the error prompt under the input box when the verification fails | boolean | `true` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| required | Whether to display the red asterisk next to the label of the required field | boolean | `false` | +| prop | The v-model field of the form field is required when the form verification function is used | string | - | +| rules | Define validation rules | FormItemRule [] | [] | +| label-width | The width of the form item label. The default unit is `px` | number \| string | `90` | +| label-align | Form item label alignment. The optional values are `center` `right` | string | `left` | +| body-align | Default Solt box alignment. The optional values are `center` `right` | string | `left` | +| error-message-align | Error prompt text alignment. The optional values are `center` and `right` | string | `left` | +| show-error-line | Whether to mark the input box in red when the verification fails | boolean | `true` | +| show-error-message | Whether to display the error prompt under the input box when the verification fails | boolean | `true` | ### FormItemRule data structure Use the `rules` attribute of FormItem to define verification rules. The optional attributes are as follows: -| Attribute | Default | Type | -| --------- | ---------------------------------- | ------------------------------------------------------- | -| required | Is it a required field | boolean | -| message | Error prompt copy | string | -| validator | Verification by function | (value:string,rule?:FormItemRule) => boolean \| Promise | -| regex | Verification by regular expression | RegExp | +| Attribute | Default | Type | +| --- | --- | --- | +| required | Is it a required field | boolean | +| message | Error prompt copy | string | +| validator | Verification by function | (value:string,rule?:FormItemRule) => boolean \| Promise | +| regex | Verification by regular expression | RegExp | ### FormItem Slots -| Name | Description | -| ------- | ------------------- | -| default | Default slot | -| label | Custom `label` slot | +| Name | Description | +| --- | --- | +| default | Default slot | +| label | Custom `label` slot | -```html +```vue use slot @@ -484,11 +473,11 @@ use slot Use [ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs) to get Form instance and call instance methods. -| Name | Description | Arguments | Return value | -| -------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------- | ------------ | -| submit | Method of submitting form for verification | - | - | -| reset | Clear verification results | - | - | -| validate | Active trigger verification is used to trigger when the user customizes the scene, such as blur and change events | Same as FormItem prop value | - | +| Name | Description | Arguments | Return value | +| --- | --- | --- | --- | +| submit | Method of submitting form for verification | - | - | +| reset | Clear verification results | - | - | +| validate | Active trigger verification is used to trigger when the user customizes the scene, such as blur and change events | Same as FormItem prop value | - | ## Theming @@ -496,18 +485,18 @@ Use [ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs) t The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| ------------------------------------- | --------------------------- | -| --nut-form-item-error-line-color | _var(--nut-required-color)_ | -| --nut-form-item-required-color | _var(--nut-required-color)_ | -| --nut-form-item-error-message-color | _var(--nut-required-color)_ | -| --nut-form-item-label-font-size | _14px_ | -| --nut-form-item-label-width | _90px_ | -| --nut-form-item-label-margin-right | _10px_ | -| --nut-form-item-label-text-align | _left_ | -| --nut-form-item-required-margin-right | _4px_ | -| --nut-form-item-body-font-size | _14px_ | -| --nut-form-item-body-slots-text-align | _left_ | -| --nut-form-item-body-input-text-align | _left_ | -| --nut-form-item-tip-font-size | _10px_ | -| --nut-form-item-tip-text-align | _left_ | +| Name | Default Value | +| --- | --- | +| --nut-form-item-error-line-color | _var(--nut-required-color)_ | +| --nut-form-item-required-color | _var(--nut-required-color)_ | +| --nut-form-item-error-message-color | _var(--nut-required-color)_ | +| --nut-form-item-label-font-size | _14px_ | +| --nut-form-item-label-width | _90px_ | +| --nut-form-item-label-margin-right | _10px_ | +| --nut-form-item-label-text-align | _left_ | +| --nut-form-item-required-margin-right | _4px_ | +| --nut-form-item-body-font-size | _14px_ | +| --nut-form-item-body-slots-text-align | _left_ | +| --nut-form-item-body-input-text-align | _left_ | +| --nut-form-item-tip-font-size | _10px_ | +| --nut-form-item-tip-text-align | _left_ | diff --git a/src/packages/__VUE/form/doc.md b/src/packages/__VUE/form/doc.md index b14d8f5f4d..14e7e6f57a 100644 --- a/src/packages/__VUE/form/doc.md +++ b/src/packages/__VUE/form/doc.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { Form, FormItem } from '@nutui/nutui'; @@ -19,7 +19,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -61,21 +56,21 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -148,14 +133,18 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -311,7 +282,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -448,50 +414,50 @@ app.use(FormItem); ### Form Props -| 参数 | 说明 | 类型 | 默认值 | -| ----------- | ------------------------------------ | ------------------------ | ------ | -| model-value | 表单数据对象(使用表单校验时,_必填_) | object | | -| rules | 统一配置每个 `FormItem` 的 `rules` | { prop: FormItemRule[] } | `{}` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| model-value | 表单数据对象(使用表单校验时,_必填_) | object | | +| rules | 统一配置每个 `FormItem` 的 `rules` | { prop: FormItemRule[] } | `{}` | ### Form Events -| 事件名 | 说明 | 回调参数 | -| -------- | -------------------------- | ------------------------------------------------------------ | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | validate | 任一表单项被校验失败后触发 | 被校验的表单项 `prop` 值,校验是否通过,错误消息(如果存在) | ### FormItem Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------- | ------------------------------------------------------------------ | ---------------- | ------- | -| required | 是否显示必填字段的标签旁边的红色星号 | boolean | `false` | -| prop | 表单域 `v-model` 字段, 在使用表单校验功能的情况下,该属性是必填的 | string | - | -| rules | 定义校验规则 | FormItemRule [] | [] | -| label-width | 表单项 `label` 宽度,默认单位为`px` | number \| string | `90` | -| label-align | 表单项 `label` 对齐方式,可选值为 `center` `right` | string | `left` | -| body-align | 右侧插槽对齐方式,可选值为 `center` `right` | string | `left` | -| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | string | `left` | -| show-error-line | 是否在校验不通过时标红输入框 | boolean | `true` | -| show-error-message | 是否在校验不通过时在输入框下方展示错误提示 | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| required | 是否显示必填字段的标签旁边的红色星号 | boolean | `false` | +| prop | 表单域 `v-model` 字段, 在使用表单校验功能的情况下,该属性是必填的 | string | - | +| rules | 定义校验规则 | FormItemRule [] | [] | +| label-width | 表单项 `label` 宽度,默认单位为`px` | number \| string | `90` | +| label-align | 表单项 `label` 对齐方式,可选值为 `center` `right` | string | `left` | +| body-align | 右侧插槽对齐方式,可选值为 `center` `right` | string | `left` | +| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | string | `left` | +| show-error-line | 是否在校验不通过时标红输入框 | boolean | `true` | +| show-error-message | 是否在校验不通过时在输入框下方展示错误提示 | boolean | `true` | ### FormItemRule 数据结构 使用 `FormItem` 的 `rules` 属性可以定义校验规则,可选属性如下: -| 键名 | 说明 | 类型 | -| --------- | ---------------------- | --------------------------------------------------------- | -| required | 是否为必选字段 | boolean | -| message | 错误提示文案 | string | -| validator | 通过函数进行校验 | (value:string, rule?:FormItemRule ) => boolean \| Promise | -| regex | 通过正则表达式进行校验 | RegExp | +| 键名 | 说明 | 类型 | +| --- | --- | --- | +| required | 是否为必选字段 | boolean | +| message | 错误提示文案 | string | +| validator | 通过函数进行校验 | (value:string, rule?:FormItemRule ) => boolean \| Promise | +| regex | 通过正则表达式进行校验 | RegExp | ### FormItem Slots -| 名称 | 说明 | -| ------- | ------------------- | -| default | 自定义内容 | -| label | 自定义 `label` 区域 | +| 名称 | 说明 | +| --- | --- | +| default | 自定义内容 | +| label | 自定义 `label` 区域 | -```html +```vue 插槽使用方式 @@ -502,11 +468,11 @@ app.use(FormItem); 通过 [ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs) 可以获取到 `Form` 实例并调用实例方法 -| 方法名 | 说明 | 参数 | 返回值 | -| -------- | ---------------------------------------------------------------------- | --------------------------------------------- | ------ | -| submit | 提交表单进行校验的方法 | - | - | -| reset | 清空校验结果 | - | - | -| validate | 用户主动触发校验,用于用户自定义场景时触发,例如 `blur`、`change` 事件 | 同 `FormItem prop` 值,不传值会校验全部 `Rule` | - | +| 方法名 | 说明 | 参数 | 返回值 | +| --- | --- | --- | --- | +| submit | 提交表单进行校验的方法 | - | - | +| reset | 清空校验结果 | - | - | +| validate | 用户主动触发校验,用于用户自定义场景时触发,例如 `blur`、`change` 事件 | 同 `FormItem prop` 值,不传值会校验全部 `Rule` | - | ## 主题定制 @@ -514,18 +480,18 @@ app.use(FormItem); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------- | --------------------------- | -| --nut-form-item-error-line-color | _var(--nut-required-color)_ | -| --nut-form-item-required-color | _var(--nut-required-color)_ | -| --nut-form-item-error-message-color | _var(--nut-required-color)_ | -| --nut-form-item-label-font-size | _14px_ | -| --nut-form-item-label-width | _90px_ | -| --nut-form-item-label-margin-right | _10px_ | -| --nut-form-item-label-text-align | _left_ | -| --nut-form-item-required-margin-right | _4px_ | -| --nut-form-item-body-font-size | _14px_ | -| --nut-form-item-body-slots-text-align | _left_ | -| --nut-form-item-body-input-text-align | _left_ | -| --nut-form-item-tip-font-size | _10px_ | -| --nut-form-item-tip-text-align | _left_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-form-item-error-line-color | _var(--nut-required-color)_ | +| --nut-form-item-required-color | _var(--nut-required-color)_ | +| --nut-form-item-error-message-color | _var(--nut-required-color)_ | +| --nut-form-item-label-font-size | _14px_ | +| --nut-form-item-label-width | _90px_ | +| --nut-form-item-label-margin-right | _10px_ | +| --nut-form-item-label-text-align | _left_ | +| --nut-form-item-required-margin-right | _4px_ | +| --nut-form-item-body-font-size | _14px_ | +| --nut-form-item-body-slots-text-align | _left_ | +| --nut-form-item-body-input-text-align | _left_ | +| --nut-form-item-tip-font-size | _10px_ | +| --nut-form-item-tip-text-align | _left_ | diff --git a/src/packages/__VUE/form/doc.taro.md b/src/packages/__VUE/form/doc.taro.md index 3136134ebc..4066d5452b 100644 --- a/src/packages/__VUE/form/doc.taro.md +++ b/src/packages/__VUE/form/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { Form, FormItem } from '@nutui/nutui-taro'; @@ -19,7 +19,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -61,21 +56,21 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -146,14 +133,18 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -307,7 +282,7 @@ app.use(FormItem); :::demo -```html +```vue - ``` @@ -444,50 +414,50 @@ app.use(FormItem); ### Form Props -| 参数 | 说明 | 类型 | 默认值 | -| ----------- | ------------------------------------ | ------------------------ | ------ | -| model-value | 表单数据对象(使用表单校验时,_必填_) | object | | -| rules | 统一配置每个 `FormItem` 的 `rules` | { prop: FormItemRule[] } | `{}` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| model-value | 表单数据对象(使用表单校验时,_必填_) | object | | +| rules | 统一配置每个 `FormItem` 的 `rules` | { prop: FormItemRule[] } | `{}` | ### Form Events -| 事件名 | 说明 | 回调参数 | -| -------- | -------------------------- | ------------------------------------------------------------ | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | validate | 任一表单项被校验失败后触发 | 被校验的表单项 `prop` 值,校验是否通过,错误消息(如果存在) | ### FormItem Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------- | ------------------------------------------------------------------ | ---------------- | ------- | -| required | 是否显示必填字段的标签旁边的红色星号 | boolean | `false` | -| prop | 表单域 `v-model` 字段, 在使用表单校验功能的情况下,该属性是必填的 | string | `-` | -| rules | 定义校验规则 | FormItemRule [] | `[]` | -| label-width | 表单项 `label` 宽度,默认单位为`px` | number \| string | `90` | -| label-align | 表单项 `label` 对齐方式,可选值为 `center` `right` | string | `left` | -| body-align | 右侧插槽对齐方式,可选值为 `center` `right` | string | `left` | -| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | string | `left` | -| show-error-line | 是否在校验不通过时标红输入框 | boolean | `true` | -| show-error-message | 是否在校验不通过时在输入框下方展示错误提示 | boolean | `true` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| required | 是否显示必填字段的标签旁边的红色星号 | boolean | `false` | +| prop | 表单域 `v-model` 字段, 在使用表单校验功能的情况下,该属性是必填的 | string | - | +| rules | 定义校验规则 | FormItemRule [] | [] | +| label-width | 表单项 `label` 宽度,默认单位为`px` | number \| string | `90` | +| label-align | 表单项 `label` 对齐方式,可选值为 `center` `right` | string | `left` | +| body-align | 右侧插槽对齐方式,可选值为 `center` `right` | string | `left` | +| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | string | `left` | +| show-error-line | 是否在校验不通过时标红输入框 | boolean | `true` | +| show-error-message | 是否在校验不通过时在输入框下方展示错误提示 | boolean | `true` | ### FormItemRule 数据结构 -使用 FormItem 的`rules`属性可以定义校验规则,可选属性如下: +使用 `FormItem` 的 `rules` 属性可以定义校验规则,可选属性如下: -| 键名 | 说明 | 类型 | -| --------- | ---------------------- | --------------------------------------------------------- | -| required | 是否为必选字段 | boolean | -| message | 错误提示文案 | string | -| validator | 通过函数进行校验 | (value:string, rule?:FormItemRule ) => boolean \| Promise | -| regex | 通过正则表达式进行校验 | RegExp | +| 键名 | 说明 | 类型 | +| --- | --- | --- | +| required | 是否为必选字段 | boolean | +| message | 错误提示文案 | string | +| validator | 通过函数进行校验 | (value:string, rule?:FormItemRule ) => boolean \| Promise | +| regex | 通过正则表达式进行校验 | RegExp | ### FormItem Slots -| 名称 | 说明 | -| ------- | ------------------- | -| default | 自定义内容 | -| label | 自定义 `label` 区域 | +| 名称 | 说明 | +| --- | --- | +| default | 自定义内容 | +| label | 自定义 `label` 区域 | -```html +```vue 插槽使用方式 @@ -496,13 +466,13 @@ app.use(FormItem); ### Methods -通过 [ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs) 可以获取到 Form 实例并调用实例方法 +通过 [ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs) 可以获取到 `Form` 实例并调用实例方法 -| 方法名 | 说明 | 参数 | 返回值 | -| -------- | ---------------------------------------------------------------------- | --------------------------------------------- | ------ | -| submit | 提交表单进行校验的方法 | - | - | -| reset | 清空校验结果 | - | - | -| validate | 用户主动触发校验,用于用户自定义场景时触发,例如 `blur`、`change` 事件 | 同 `FormItem prop` 值,不传值会校验全部 `Rule` | - | +| 方法名 | 说明 | 参数 | 返回值 | +| --- | --- | --- | --- | +| submit | 提交表单进行校验的方法 | - | - | +| reset | 清空校验结果 | - | - | +| validate | 用户主动触发校验,用于用户自定义场景时触发,例如 `blur`、`change` 事件 | 同 `FormItem prop` 值,不传值会校验全部 `Rule` | - | ## 主题定制 @@ -510,18 +480,18 @@ app.use(FormItem); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------- | --------------------------- | -| --nut-form-item-error-line-color | _var(--nut-required-color)_ | -| --nut-form-item-required-color | _var(--nut-required-color)_ | -| --nut-form-item-error-message-color | _var(--nut-required-color)_ | -| --nut-form-item-label-font-size | _14px_ | -| --nut-form-item-label-width | _90px_ | -| --nut-form-item-label-margin-right | _10px_ | -| --nut-form-item-label-text-align | _left_ | -| --nut-form-item-required-margin-right | _4px_ | -| --nut-form-item-body-font-size | _14px_ | -| --nut-form-item-body-slots-text-align | _left_ | -| --nut-form-item-body-input-text-align | _left_ | -| --nut-form-item-tip-font-size | _10px_ | -| --nut-form-item-tip-text-align | _left_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-form-item-error-line-color | _var(--nut-required-color)_ | +| --nut-form-item-required-color | _var(--nut-required-color)_ | +| --nut-form-item-error-message-color | _var(--nut-required-color)_ | +| --nut-form-item-label-font-size | _14px_ | +| --nut-form-item-label-width | _90px_ | +| --nut-form-item-label-margin-right | _10px_ | +| --nut-form-item-label-text-align | _left_ | +| --nut-form-item-required-margin-right | _4px_ | +| --nut-form-item-body-font-size | _14px_ | +| --nut-form-item-body-slots-text-align | _left_ | +| --nut-form-item-body-input-text-align | _left_ | +| --nut-form-item-tip-font-size | _10px_ | +| --nut-form-item-tip-text-align | _left_ | diff --git a/src/packages/__VUE/inputnumber/doc.en-US.md b/src/packages/__VUE/inputnumber/doc.en-US.md index ca3b02d705..8ae531cfd4 100644 --- a/src/packages/__VUE/inputnumber/doc.en-US.md +++ b/src/packages/__VUE/inputnumber/doc.en-US.md @@ -6,7 +6,7 @@ Control the number increase or decrease by clicking the button. ### Install -```javascript +```js import { createApp } from 'vue'; import { InputNumber } from '@nutui/nutui'; @@ -20,18 +20,13 @@ Initialize a default value :::demo -```html +```vue - ``` @@ -43,18 +38,13 @@ Set step `step` 5 :::demo -```html +```vue - ``` @@ -66,18 +56,13 @@ Set step `step` 5 :::demo -```html +```vue - ``` @@ -89,18 +74,13 @@ Set step `step` 5 :::demo -```html +```vue - ``` @@ -112,18 +92,13 @@ Set step `step` 5 :::demo -```html +```vue - ``` @@ -135,18 +110,13 @@ Set step size `step` 0.1 `decimal places` keep 1 decimal place :::demo -```html +```vue - ``` @@ -158,29 +128,21 @@ Asynchronous modification through `change` event and `model-value` :::demo -```html +```vue - ``` @@ -190,18 +152,13 @@ Asynchronous modification through `change` event and `model-value` :::demo -```html +```vue - ``` @@ -211,7 +168,7 @@ Asynchronous modification through `change` event and `model-value` :::demo -```html +```vue - ``` @@ -241,35 +192,35 @@ Asynchronous modification through `change` event and `model-value` ### Props -| Attribute | Description | Type | Default | -| -------------- | ------------------------------------------------------ | ---------------- | ------- | -| v-model | Initial value | string \| number | - | -| input-width | Input box width | string | `` | -| button-size | Operators +, - Dimensions | string | `` | -| min | Minimum limit | string \| number | `1` | -| max | Maximum limit | string \| number | `9999` | -| step | step | string \| number | `1` | -| decimal-places | Set reserved decimal places | string \| number | `0` | -| disabled | Disable all features | boolean | `false` | -| readonly | Read only status disables input box operation behavior | boolean | `false` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | Initial value | string \| number | - | +| input-width | Input box width | string | `` | +| button-size | Operators +, - Dimensions | string | `` | +| min | Minimum limit | string \| number | `1` | +| max | Maximum limit | string \| number | `9999` | +| step | step | string \| number | `1` | +| decimal-places | Set reserved decimal places | string \| number | `0` | +| disabled | Disable all features | boolean | `false` | +| readonly | Read only status disables input box operation behavior | boolean | `false` | ### Slots -| Name | Description | -| ---------- | ----------------- | -| left-icon | Custom left icon | +| Name | Description | +| --- | --- | +| left-icon | Custom left icon | | right-icon | Custom right icon | ### Events -| Event | Description | Arguments | -| --------- | ----------------------------------------------- | ------------------------------------------ | -| add | Triggered when the Add button is clicked | `event: Event ` | -| reduce | Triggered when the decrease button is clicked | `event: Event` | +| Event | Description | Arguments | +| --- | --- | --- | +| add | Triggered when the Add button is clicked | `event: Event ` | +| reduce | Triggered when the decrease button is clicked | `event: Event` | | overlimit | Triggered when an unavailable button is clicked | `event: Event,type:string (reduce or add)` | -| change | Triggered when the value changes | `value: number , event : Event ` | -| blur | Triggered when the input box blur | `event: Event` | -| focus | Triggered when the input box focus | `event: Event ` | +| change | Triggered when the value changes | `value: number , event : Event ` | +| blur | Triggered when the input box blur | `event: Event` | +| focus | Triggered when the input box focus | `event: Event ` | ## Theming @@ -277,21 +228,21 @@ Asynchronous modification through `change` event and `model-value` The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| ---------------------------------------- | -------------------------- | -| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | -| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | -| --nut-inputnumber-icon-size | _20px_ | -| --nut-inputnumber-input-width | _40px_ | -| --nut-inputnumber-input-font-size | _12px_ | -| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | -| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | -| --nut-inputnumber-input-border-radius | _4px_ | -| --nut-inputnumber-input-margin | _0 6px_ | -| --nut-inputnumber-input-border | _0_ | -| --nut-inputnumber-border | _0_ | -| --nut-inputnumber-border-radius | _0_ | -| --nut-inputnumber-height | _auto_ | -| --nut-inputnumber-line-height | _normal_ | -| --nut-inputnumber-border-box | _content-box_ | -| --nut-inputnumber-display | _inline-flex_ | +| Name | Default Value | +| --- | --- | +| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | +| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | +| --nut-inputnumber-icon-size | _20px_ | +| --nut-inputnumber-input-width | _40px_ | +| --nut-inputnumber-input-font-size | _12px_ | +| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | +| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | +| --nut-inputnumber-input-border-radius | _4px_ | +| --nut-inputnumber-input-margin | _0 6px_ | +| --nut-inputnumber-input-border | _0_ | +| --nut-inputnumber-border | _0_ | +| --nut-inputnumber-border-radius | _0_ | +| --nut-inputnumber-height | _auto_ | +| --nut-inputnumber-line-height | _normal_ | +| --nut-inputnumber-border-box | _content-box_ | +| --nut-inputnumber-display | _inline-flex_ | diff --git a/src/packages/__VUE/inputnumber/doc.md b/src/packages/__VUE/inputnumber/doc.md index f7e010a260..ea40d67abb 100644 --- a/src/packages/__VUE/inputnumber/doc.md +++ b/src/packages/__VUE/inputnumber/doc.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { InputNumber } from '@nutui/nutui'; @@ -20,18 +20,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -43,18 +38,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -66,18 +56,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -89,18 +74,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -112,18 +92,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -135,18 +110,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -158,29 +128,21 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -190,18 +152,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -211,7 +168,7 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -241,35 +192,35 @@ app.use(InputNumber); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| -------------- | -------------------------- | ---------------- | ------- | -| v-model | 初始值 | string \| number | - | -| input-width | 输入框宽度 | string | `` | -| button-size | 操作符+、-尺寸 | string | `` | -| min | 最小值限制 | string \| number | `1` | -| max | 最大值限制 | string \| number | `9999` | -| step | 步长 | string \| number | `1` | -| decimal-places | 设置保留的小数位 | string \| number | `0` | -| disabled | 禁用所有功能 | boolean | `false` | -| readonly | 只读状态禁用输入框操作行为 | boolean | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 初始值 | string \| number | - | +| input-width | 输入框宽度 | string | `` | +| button-size | 操作符+、-尺寸 | string | `` | +| min | 最小值限制 | string \| number | `1` | +| max | 最大值限制 | string \| number | `9999` | +| step | 步长 | string \| number | `1` | +| decimal-places | 设置保留的小数位 | string \| number | `0` | +| disabled | 禁用所有功能 | boolean | `false` | +| readonly | 只读状态禁用输入框操作行为 | boolean | `false` | ### Slots -| 名称 | 说明 | -| ---------- | -------------- | -| left-icon | 自定义左侧按钮 | +| 名称 | 说明 | +| --- | --- | +| left-icon | 自定义左侧按钮 | | right-icon | 自定义右侧按钮 | ### Events -| 事件名 | 说明 | 回调参数 | -| --------- | ---------------------- | --------------------------------------------- | -| add | 点击增加按钮时触发 | `(event: Event)` | -| reduce | 点击减少按钮时触发 | `(event: Event) ` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| add | 点击增加按钮时触发 | `(event: Event)` | +| reduce | 点击减少按钮时触发 | `(event: Event) ` | | overlimit | 点击不可用的按钮时触发 | `(event: Event,type:string (reduce or add) )` | -| change | 值改变时触发 | `(value: number , event : Event) ` | -| blur | 输入框失去焦点时触发 | `(event: Event) ` | -| focus | 输入框获得焦点时触发 | `(event: Event ) ` | +| change | 值改变时触发 | `(value: number , event : Event) ` | +| blur | 输入框失去焦点时触发 | `(event: Event) ` | +| focus | 输入框获得焦点时触发 | `(event: Event ) ` | ## 主题定制 @@ -277,21 +228,21 @@ app.use(InputNumber); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ---------------------------------------- | -------------------------- | -| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | -| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | -| --nut-inputnumber-icon-size | _20px_ | -| --nut-inputnumber-input-width | _40px_ | -| --nut-inputnumber-input-font-size | _12px_ | -| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | -| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | -| --nut-inputnumber-input-border-radius | _4px_ | -| --nut-inputnumber-input-margin | _0 6px_ | -| --nut-inputnumber-input-border | _0_ | -| --nut-inputnumber-border | _0_ | -| --nut-inputnumber-border-radius | _0_ | -| --nut-inputnumber-height | _auto_ | -| --nut-inputnumber-line-height | _normal_ | -| --nut-inputnumber-border-box | _content-box_ | -| --nut-inputnumber-display | _inline-flex_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | +| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | +| --nut-inputnumber-icon-size | _20px_ | +| --nut-inputnumber-input-width | _40px_ | +| --nut-inputnumber-input-font-size | _12px_ | +| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | +| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | +| --nut-inputnumber-input-border-radius | _4px_ | +| --nut-inputnumber-input-margin | _0 6px_ | +| --nut-inputnumber-input-border | _0_ | +| --nut-inputnumber-border | _0_ | +| --nut-inputnumber-border-radius | _0_ | +| --nut-inputnumber-height | _auto_ | +| --nut-inputnumber-line-height | _normal_ | +| --nut-inputnumber-border-box | _content-box_ | +| --nut-inputnumber-display | _inline-flex_ | diff --git a/src/packages/__VUE/inputnumber/doc.taro.md b/src/packages/__VUE/inputnumber/doc.taro.md index ef67f15df9..74216f98c8 100644 --- a/src/packages/__VUE/inputnumber/doc.taro.md +++ b/src/packages/__VUE/inputnumber/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { InputNumber } from '@nutui/nutui-taro'; @@ -20,18 +20,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -43,18 +38,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -66,18 +56,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -89,18 +74,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -112,18 +92,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -135,18 +110,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -158,26 +128,19 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -187,18 +150,13 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -208,7 +166,7 @@ app.use(InputNumber); :::demo -```html +```vue - ``` @@ -238,35 +190,35 @@ app.use(InputNumber); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| -------------- | -------------------------- | ---------------- | ------- | -| v-model | 初始值 | string \| number | - | -| input-width | 输入框宽度 | string | `` | -| button-size | 操作符+、-尺寸 | string | `` | -| min | 最小值限制 | string \| number | `1` | -| max | 最大值限制 | string \| number | `9999` | -| step | 步长 | string \| number | `1` | -| decimal-places | 设置保留的小数位 | string \| number | `0` | -| disabled | 禁用所有功能 | boolean | `false` | -| readonly | 只读状态禁用输入框操作行为 | boolean | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 初始值 | string \| number | - | +| input-width | 输入框宽度 | string | `` | +| button-size | 操作符+、-尺寸 | string | `` | +| min | 最小值限制 | string \| number | `1` | +| max | 最大值限制 | string \| number | `9999` | +| step | 步长 | string \| number | `1` | +| decimal-places | 设置保留的小数位 | string \| number | `0` | +| disabled | 禁用所有功能 | boolean | `false` | +| readonly | 只读状态禁用输入框操作行为 | boolean | `false` | ### Slots -| 名称 | 说明 | -| ---------- | -------------- | -| left-icon | 自定义左侧按钮 | +| 名称 | 说明 | +| --- | --- | +| left-icon | 自定义左侧按钮 | | right-icon | 自定义右侧按钮 | ### Events -| 事件名 | 说明 | 回调参数 | -| --------- | ---------------------- | --------------------------------------------- | -| add | 点击增加按钮时触发 | `(event: Event)` | -| reduce | 点击减少按钮时触发 | `(event: Event)` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| add | 点击增加按钮时触发 | `(event: Event)` | +| reduce | 点击减少按钮时触发 | `(event: Event) ` | | overlimit | 点击不可用的按钮时触发 | `(event: Event,type:string (reduce or add) )` | -| change | 值改变时触发 | `(value: number , event : Event)` | -| blur | 输入框失去焦点时触发 | `(event: Event)` | -| focus | 输入框获得焦点时触发 | `(event: Event ) ` | +| change | 值改变时触发 | `(value: number , event : Event) ` | +| blur | 输入框失去焦点时触发 | `(event: Event) ` | +| focus | 输入框获得焦点时触发 | `(event: Event ) ` | ## 主题定制 @@ -274,21 +226,21 @@ app.use(InputNumber); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ---------------------------------------- | -------------------------- | -| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | -| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | -| --nut-inputnumber-icon-size | _20px_ | -| --nut-inputnumber-input-width | _40px_ | -| --nut-inputnumber-input-font-size | _12px_ | -| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | -| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | -| --nut-inputnumber-input-border-radius | _4px_ | -| --nut-inputnumber-input-margin | _0 6px_ | -| --nut-inputnumber-input-border | _0_ | -| --nut-inputnumber-border | _0_ | -| --nut-inputnumber-border-radius | _0_ | -| --nut-inputnumber-height | _auto_ | -| --nut-inputnumber-line-height | _normal_ | -| --nut-inputnumber-border-box | _content-box_ | -| --nut-inputnumber-display | _inline-flex_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-inputnumber-icon-color | _var(--nut-title-color)_ | +| --nut-inputnumber-icon-void-color | _var(--nut-disable-color)_ | +| --nut-inputnumber-icon-size | _20px_ | +| --nut-inputnumber-input-width | _40px_ | +| --nut-inputnumber-input-font-size | _12px_ | +| --nut-inputnumber-input-font-color | _var(--nut-title-color)_ | +| --nut-inputnumber-input-background-color | _var(--nut-help-color)_ | +| --nut-inputnumber-input-border-radius | _4px_ | +| --nut-inputnumber-input-margin | _0 6px_ | +| --nut-inputnumber-input-border | _0_ | +| --nut-inputnumber-border | _0_ | +| --nut-inputnumber-border-radius | _0_ | +| --nut-inputnumber-height | _auto_ | +| --nut-inputnumber-line-height | _normal_ | +| --nut-inputnumber-border-box | _content-box_ | +| --nut-inputnumber-display | _inline-flex_ | diff --git a/src/packages/__VUE/numberkeyboard/demo.vue b/src/packages/__VUE/numberkeyboard/demo.vue index 023b75bcb8..27b1f5401f 100644 --- a/src/packages/__VUE/numberkeyboard/demo.vue +++ b/src/packages/__VUE/numberkeyboard/demo.vue @@ -10,7 +10,7 @@ :custom-key="customKey1" :confirm-text="translate('confirmText')" @input="input" - @close="close(2)" + @close="close" @blur="onBlur(2)" > @@ -21,7 +21,7 @@ :random-keys="true" :custom-key="customKey1" @input="input" - @close="close(3)" + @close="close" @blur="onBlur(3)" > @@ -32,7 +32,7 @@ :title="translate('title')" :custom-key="customKey2" @input="input" - @close="close(4)" + @close="close" @blur="onBlur(4)" > @@ -43,7 +43,7 @@ :custom-key="customKey3" @input="input" @blur="onBlur(6)" - @close="close(6)" + @close="close" > - + - diff --git a/src/packages/__VUE/radio/doc.en-US.md b/src/packages/__VUE/radio/doc.en-US.md index 285a684258..6293306fee 100644 --- a/src/packages/__VUE/radio/doc.en-US.md +++ b/src/packages/__VUE/radio/doc.en-US.md @@ -6,7 +6,7 @@ Used to make a single selection in a set of alternatives ### Install -```ts +```js import { createApp } from 'vue'; import { Radio, RadioGroup } from '@nutui/nutui'; @@ -21,7 +21,7 @@ Bind the **label** of the current option through **v-model**. And it must be use :::demo -```html +```vue - ``` @@ -65,7 +59,7 @@ Bind the **label** of the current option through **v-model**. And it must be use :::demo -```html +```vue - ``` @@ -109,7 +97,7 @@ Bind the **label** of the current option through **v-model**. And it must be use :::demo -```html +```vue - ``` @@ -140,7 +122,7 @@ Customize the icon through the slot, it is recommended to set the `icon` and `ch :::demo -```html +```vue - ``` @@ -180,7 +154,7 @@ Customize the icon through the slot, it is recommended to set the `icon` and `ch :::demo -```html +```vue - ``` @@ -213,32 +181,32 @@ Customize the icon through the slot, it is recommended to set the `icon` and `ch ### Radio Props -| Attribute | Description | Type | Default | -| --------- | -------------------------------------------- | --------------------------- | ------- | -| disabled | Disable selection | boolean | `false` | -| icon-size | [Icon Size](#/en-US/icon) | string \| number | `18` | -| label | Radio box ID | string \| number \| boolean | - | -| shape | Shape, optional values are `button`、`round` | string | `round` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| disabled | Disable selection | boolean | `false` | +| icon-size | [Icon Size](#/en-US/icon) | string \| number | `18` | +| label | Radio box ID | string \| number \| boolean | - | +| shape | Shape, optional values are `button`、`round` | string | `round` | ### Radio Slots -| Name | Description | -| ----------- | ---------------------- | -| icon | Icon when not selected | -| checkedIcon | Icon when selected | +| Name | Description | +| --- | --- | +| icon | Icon when not selected | +| checkedIcon | Icon when selected | ### RadioGroup Props -| Attribute | Description | Type | Default | -| ------------- | ------------------------------------------------------------------------------------------------------ | --------------------------- | ---------- | -| v-model | The identifier of the currently selected item is selected when it is consistent with the `label` value | string \| number \| boolean | - | -| text-position | The position of the text, optional value:`left`,`right` | string | `right` | -| direction | Use horizontal and vertical optional values `horizontal`、`vertical` | string | `vertical` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | The identifier of the currently selected item is selected when it is consistent with the `label` value | string \| number \| boolean | - | +| text-position | The position of the text, optional value:`left`,`right` | string | `right` | +| direction | Use horizontal and vertical optional values `horizontal`、`vertical` | string | `vertical` | ### RadioGroup Events -| Event | Description | Arguments | -| ------ | -------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| Event | Description | Arguments | +| --- | --- | --- | | change | Triggered when the value changes | Currently selected item value(label)【There is a value after setting `label`, which is empty by default】 | ## Theming @@ -247,17 +215,17 @@ Customize the icon through the slot, it is recommended to set the `icon` and `ch The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/component/configprovider). -| Name | Default Value | -| ------------------------------------- | -------------------------- | -| --nut-radio-label-font-color | _#1d1e1e_ | -| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | -| --nut-radio-label-disable-color | _#999_ | -| --nut-radio-icon-disable-color | _#d6d6d6_ | +| Name | Default Value | +| --- | --- | +| --nut-radio-label-font-color | _#1d1e1e_ | +| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | +| --nut-radio-label-disable-color | _#999_ | +| --nut-radio-icon-disable-color | _#d6d6d6_ | | --nut-radio-label-button-border-color | _var(--nut-primary-color)_ | -| --nut-radio-label-button-background | _var(--nut-primary-color)_ | -| --nut-radio-label-margin-left | _15px_ | -| --nut-radio-button-border-radius | _15px_ | -| --nut-radio-label-font-size | _14px_ | -| --nut-radio-button-font-size | _12px_ | -| --nut-radio-button-padding | _5px 18px_ | -| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-radio-label-button-background | _var(--nut-primary-color)_ | +| --nut-radio-label-margin-left | _15px_ | +| --nut-radio-button-border-radius | _15px_ | +| --nut-radio-label-font-size | _14px_ | +| --nut-radio-button-font-size | _12px_ | +| --nut-radio-button-padding | _5px 18px_ | +| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | diff --git a/src/packages/__VUE/radio/doc.md b/src/packages/__VUE/radio/doc.md index b66274decf..4433492304 100644 --- a/src/packages/__VUE/radio/doc.md +++ b/src/packages/__VUE/radio/doc.md @@ -6,7 +6,7 @@ ### 安装 -```ts +```js import { createApp } from 'vue'; import { Radio, RadioGroup } from '@nutui/nutui'; @@ -21,7 +21,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -65,7 +59,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -109,7 +97,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -140,7 +122,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -180,7 +154,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -213,32 +181,32 @@ app.use(RadioGroup); ### Radio Props -| 参数 | 说明 | 类型 | 默认值 | -| --------- | ---------------------------------- | --------------------------- | ------- | -| disabled | 是否禁用选择 | boolean | `false` | -| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | -| label | 单选框标识 | string \| number \| boolean | - | -| shape | 形状,可选值为 `button`、`round` | string | `round` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| disabled | 是否禁用选择 | boolean | `false` | +| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | +| label | 单选框标识 | string \| number \| boolean | - | +| shape | 形状,可选值为 `button`、`round` | string | `round` | ### Radio Slots -| 名称 | 说明 | -| ----------- | -------------- | -| icon | 未选中时的图标 | -| checkedIcon | 选中时的图标 | +| 名称 | 说明 | +| --- | --- | +| icon | 未选中时的图标 | +| checkedIcon | 选中时的图标 | ### RadioGroup Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ------------------------------------------------- | --------------------------- | ---------- | -| v-model | 当前选中项的标识符,与 `label` 值一致时呈选中状态 | string \| number \| boolean | - | -| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | -| direction | 使用横纵方向 可选值 `horizontal、vertical ` | string | `vertical` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前选中项的标识符,与 `label` 值一致时呈选中状态 | string \| number \| boolean | - | +| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | +| direction | 使用横纵方向 可选值 `horizontal、vertical ` | string | `vertical` | ### RadioGroup Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | ---------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | 当前选中项值(label)【设置 label 后有值、默认为空】 | ## 主题定制 @@ -247,17 +215,17 @@ app.use(RadioGroup); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------- | -------------------------- | -| --nut-radio-label-font-color | _#1d1e1e_ | -| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | -| --nut-radio-label-disable-color | _#999_ | -| --nut-radio-icon-disable-color | _#d6d6d6_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-radio-label-font-color | _#1d1e1e_ | +| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | +| --nut-radio-label-disable-color | _#999_ | +| --nut-radio-icon-disable-color | _#d6d6d6_ | | --nut-radio-label-button-border-color | _var(--nut-primary-color)_ | -| --nut-radio-label-button-background | _var(--nut-primary-color)_ | -| --nut-radio-label-margin-left | _15px_ | -| --nut-radio-button-border-radius | _15px_ | -| --nut-radio-label-font-size | _14px_ | -| --nut-radio-button-font-size | _12px_ | -| --nut-radio-button-padding | _5px 18px_ | -| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-radio-label-button-background | _var(--nut-primary-color)_ | +| --nut-radio-label-margin-left | _15px_ | +| --nut-radio-button-border-radius | _15px_ | +| --nut-radio-label-font-size | _14px_ | +| --nut-radio-button-font-size | _12px_ | +| --nut-radio-button-padding | _5px 18px_ | +| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | diff --git a/src/packages/__VUE/radio/doc.taro.md b/src/packages/__VUE/radio/doc.taro.md index f86f3cd6ad..5f51b0b512 100644 --- a/src/packages/__VUE/radio/doc.taro.md +++ b/src/packages/__VUE/radio/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```ts +```js import { createApp } from 'vue'; import { Radio, RadioGroup } from '@nutui/nutui-taro'; @@ -21,7 +21,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -65,7 +59,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -109,7 +97,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -140,7 +122,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -180,7 +154,7 @@ app.use(RadioGroup); :::demo -```html +```vue - ``` @@ -213,32 +181,32 @@ app.use(RadioGroup); ### Radio Props -| 参数 | 说明 | 类型 | 默认值 | -| --------- | ---------------------------------- | --------------------------- | ------- | -| disabled | 是否禁用选择 | boolean | `false` | -| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | -| label | 单选框标识 | string \| number \| boolean | - | -| shape | 形状,可选值为 button、round | string | `round` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| disabled | 是否禁用选择 | boolean | `false` | +| icon-size | [图标尺寸](#/zh-CN/component/icon) | string \| number | `18` | +| label | 单选框标识 | string \| number \| boolean | - | +| shape | 形状,可选值为 `button`、`round` | string | `round` | ### Radio Slots -| 名称 | 说明 | -| ----------- | -------------- | -| icon | 未选中时的图标 | -| checkedIcon | 选中时的图标 | +| 名称 | 说明 | +| --- | --- | +| icon | 未选中时的图标 | +| checkedIcon | 选中时的图标 | ### RadioGroup Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ------------------------------------------------- | --------------------------- | ---------- | -| v-model | 当前选中项的标识符,与 `label` 值一致时呈选中状态 | string \| number \| boolean | - | -| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | -| direction | 使用横纵方向 可选值 `horizontal、vertical ` | string | `vertical` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前选中项的标识符,与 `label` 值一致时呈选中状态 | string \| number \| boolean | - | +| text-position | 文本所在的位置,可选值:`left`,`right` | string | `right` | +| direction | 使用横纵方向 可选值 `horizontal、vertical ` | string | `vertical` | ### RadioGroup Events -| 事件名 | 说明 | 回调参数 | -| ------ | ------------ | ---------------------------------------------------- | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | | change | 值变化时触发 | 当前选中项值(label)【设置 label 后有值、默认为空】 | ## 主题定制 @@ -247,17 +215,17 @@ app.use(RadioGroup); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------- | -------------------------- | -| --nut-radio-label-font-color | _#1d1e1e_ | -| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | -| --nut-radio-label-disable-color | _#999_ | -| --nut-radio-icon-disable-color | _#d6d6d6_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-radio-label-font-color | _#1d1e1e_ | +| --nut-radio-label-font-active-color | _var(--nut-primary-color)_ | +| --nut-radio-label-disable-color | _#999_ | +| --nut-radio-icon-disable-color | _#d6d6d6_ | | --nut-radio-label-button-border-color | _var(--nut-primary-color)_ | -| --nut-radio-label-button-background | _var(--nut-primary-color)_ | -| --nut-radio-label-margin-left | _15px_ | -| --nut-radio-button-border-radius | _15px_ | -| --nut-radio-label-font-size | _14px_ | -| --nut-radio-button-font-size | _12px_ | -| --nut-radio-button-padding | _5px 18px_ | -| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | +| --nut-radio-label-button-background | _var(--nut-primary-color)_ | +| --nut-radio-label-margin-left | _15px_ | +| --nut-radio-button-border-radius | _15px_ | +| --nut-radio-label-font-size | _14px_ | +| --nut-radio-button-font-size | _12px_ | +| --nut-radio-button-padding | _5px 18px_ | +| --nut-radio-icon-disable-color2 | _var(--nut-help-color)_ | diff --git a/src/packages/__VUE/range/demo.vue b/src/packages/__VUE/range/demo.vue index 308bbabef5..9077bfb225 100644 --- a/src/packages/__VUE/range/demo.vue +++ b/src/packages/__VUE/range/demo.vue @@ -2,36 +2,36 @@

{{ translate('title') }}

- +

{{ translate('title1') }}

- +

{{ translate('title2') }}

- +

{{ translate('title3') }}

- +

{{ translate('title4') }}

- +

{{ translate('title5') }}

- +

{{ translate('title6') }}

- +

{{ translate('title7') }}

{{ translate('title8') }}

- + @@ -50,36 +50,36 @@

{{ translate('title9') }}

- + - +

{{ translate('title10') }}

- + - + @@ -88,8 +88,8 @@
- - ``` @@ -250,45 +175,45 @@ app.use(Searchbar); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------------------ | --------------------------------------------------- | ---------------- | ------------- | -| v-model | 当前输入的值 | number \| string | `''` | -| label | 搜索框左侧文本 | string | `''` | -| shape | 搜索框形状,可选值为 `square` `round` | string | `round` | -| max-length | 最大输入长度 | number \| string | `9999` | -| input-type | 输入框类型 | string | `text` | -| placeholder | 输入框默认暗纹 | string | `请输入` | -| clearable | 是否展示清除按钮 | boolean | `true` | -| clear-icon | 自定义清除按钮图标(默认使用 `@nutui/nutui-icons`) | Object | `CircleClose` | -| background | 输入框外部背景 | string | `#fff` | -| input-background | 输入框内部背景 | string | `#f7f7f7` | -| autofocus | 是否自动聚焦 | boolean | `false` | -| focus-style | 聚焦时搜索框样式 | Object | `-` | -| disabled | 是否禁用输入框 | boolean | `false` | -| readonly | 输入框只读 | boolean | `false` | -| input-align | 对齐方式,可选`left` `center` `right` | string | `left` | -| safe-area-inset-bottom`v4.1.6` | 是否开启 iphone 系列全面屏底部安全区适配 | boolean | `false` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前输入的值 | number \| string | `''` | +| label | 搜索框左侧文本 | string | `''` | +| shape | 搜索框形状,可选值为 `square` `round` | string | `round` | +| max-length | 最大输入长度 | number \| string | `9999` | +| input-type | 输入框类型 | string | `text` | +| placeholder | 输入框默认暗纹 | string | `请输入` | +| clearable | 是否展示清除按钮 | boolean | `true` | +| clear-icon | 自定义清除按钮图标(默认使用 `@nutui/nutui-icons`) | Object | `CircleClose` | +| background | 输入框外部背景 | string | `#fff` | +| input-background | 输入框内部背景 | string | `#f7f7f7` | +| autofocus | 是否自动聚焦 | boolean | `false` | +| focus-style | 聚焦时搜索框样式 | Object | `-` | +| disabled | 是否禁用输入框 | boolean | `false` | +| readonly | 输入框只读 | boolean | `false` | +| input-align | 对齐方式,可选`left` `center` `right` | string | `left` | +| safe-area-inset-bottom`v4.1.6` | 是否开启 iphone 系列全面屏底部安全区适配 | boolean | `false` | ### Events -| 事件名 | 说明 | 回调参数 | -| ---------------- | ------------------- | ------------ | -| change | 输入内容时触发 | `val, event` | -| focus | 聚焦时触发 | `val, event` | -| blur | 失焦时触发 | `val, event` | -| clear | 点击清空时触发 | `val` | -| search | 按下 ENTER 键时触发 | `val, event` | -| click-input | 点击输入区域时触发 | `event` | -| click-left-icon | 点击左侧图标时触发 | `val, event` | -| click-right-icon | 点击右侧图标时触发 | `val, event` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| change | 输入内容时触发 | `val, event` | +| focus | 聚焦时触发 | `val, event` | +| blur | 失焦时触发 | `val, event` | +| clear | 点击清空时触发 | `val` | +| search | 按下 ENTER 键时触发 | `val, event` | +| click-input | 点击输入区域时触发 | `event` | +| click-left-icon | 点击左侧图标时触发 | `val, event` | +| click-right-icon | 点击右侧图标时触发 | `val, event` | ### Slots -| 名称 | 说明 | -| -------- | ---------------- | -| leftin | 输入框内 左 icon | -| leftout | 输入框外 左 icon | -| rightin | 输入框内 右 icon | +| 名称 | 说明 | +| --- | --- | +| leftin | 输入框内 左 icon | +| leftout | 输入框外 左 icon | +| rightin | 输入框内 右 icon | | rightout | 输入框外 右 icon | ## 主题定制 @@ -297,17 +222,17 @@ app.use(Searchbar); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------------- | ------------------------------- | -| --nut-searchbar-background | _var(--nut-white)_ | -| --nut-searchbar-right-out-color | _var(--nut-black)_ | -| --nut-searchbar-padding | _9px 16px_ | -| --nut-searchbar-width | _100%_ | -| --nut-searchbar-input-background | _#f7f7f7_ | -| --nut-searchbar-input-padding | _0 0 0 13px_ | -| --nut-searchbar-input-height | _32px_ | -| --nut-searchbar-input-width | _100%_ | -| --nut-searchbar-input-border-radius | _16px_ | -| --nut-searchbar-input-box-shadow | _0 0 8px 0 rgba(0, 0, 0, 0.04)_ | -| --nut-searchbar-input-bar-color | _inherit_ | -| --nut-searchbar-input-bar-placeholder-color | _inherit_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-searchbar-background | _var(--nut-white)_ | +| --nut-searchbar-right-out-color | _var(--nut-black)_ | +| --nut-searchbar-padding | _9px 16px_ | +| --nut-searchbar-width | _100%_ | +| --nut-searchbar-input-background | _#f7f7f7_ | +| --nut-searchbar-input-padding | _0 0 0 13px_ | +| --nut-searchbar-input-height | _32px_ | +| --nut-searchbar-input-width | _100%_ | +| --nut-searchbar-input-border-radius | _16px_ | +| --nut-searchbar-input-box-shadow | _0 0 8px 0 rgba(0, 0, 0, 0.04)_ | +| --nut-searchbar-input-bar-color | _inherit_ | +| --nut-searchbar-input-bar-placeholder-color | _inherit_ | diff --git a/src/packages/__VUE/searchbar/doc.taro.md b/src/packages/__VUE/searchbar/doc.taro.md index 09d44d9856..b07d9ba318 100644 --- a/src/packages/__VUE/searchbar/doc.taro.md +++ b/src/packages/__VUE/searchbar/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { Searchbar } from '@nutui/nutui-taro'; @@ -18,23 +18,13 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -44,7 +34,7 @@ app.use(Searchbar); :::demo -```html +```vue @@ -56,28 +46,18 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -87,29 +67,18 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -119,25 +88,15 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -147,24 +106,14 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -174,29 +123,19 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -206,9 +145,9 @@ app.use(Searchbar); :::demo -```html +```vue - ``` @@ -247,47 +175,47 @@ app.use(Searchbar); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------- | -| v-model | 当前输入的值 | number \| string | `''` | -| label | 搜索框左侧文本 | string | `''` | -| shape | 搜索框形状,可选值为 `square` `round` | string | `round` | -| max-length | 最大输入长度 | number \| string | `9999` | -| input-type | 输入框类型 | string | `text` | -| placeholder | 输入框默认暗纹 | string | `请输入` | -| clearable | 是否展示清除按钮 | boolean | `true` | -| clear-icon | 自定义清除按钮图标(默认使用 `@nutui/nutui-icons`) | Object | `CircleClose` | -| background | 输入框外部背景 | string | `#fff` | -| input-background | 输入框内部背景 | string | `#f7f7f7` | -| confirm-type | 键盘右下角按钮的文字,仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成 | string | `done` | -| autofocus | 是否自动聚焦 | boolean | `false` | -| focus-style | 聚焦时搜索框样式 | Object | `-` | -| disabled | 是否禁用输入框 | boolean | `false` | -| readonly | 输入框只读 | boolean | `false` | -| input-align | 对齐方式,可选 `left` `center` `right` | string | `left` | -| safe-area-inset-bottom`v4.1.6` | 是否开启 iphone 系列全面屏底部安全区适配 | boolean | `false` | -| cursor-spacing`v4.1.7` | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | number | 0 | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 当前输入的值 | number \| string | `''` | +| label | 搜索框左侧文本 | string | `''` | +| shape | 搜索框形状,可选值为 `square` `round` | string | `round` | +| max-length | 最大输入长度 | number \| string | `9999` | +| input-type | 输入框类型 | string | `text` | +| placeholder | 输入框默认暗纹 | string | `请输入` | +| clearable | 是否展示清除按钮 | boolean | `true` | +| clear-icon | 自定义清除按钮图标(默认使用 `@nutui/nutui-icons`) | Object | `CircleClose` | +| background | 输入框外部背景 | string | `#fff` | +| input-background | 输入框内部背景 | string | `#f7f7f7` | +| confirm-type | 键盘右下角按钮的文字,仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成 | string | `done` | +| autofocus | 是否自动聚焦 | boolean | `false` | +| focus-style | 聚焦时搜索框样式 | Object | `-` | +| disabled | 是否禁用输入框 | boolean | `false` | +| readonly | 输入框只读 | boolean | `false` | +| input-align | 对齐方式,可选 `left` `center` `right` | string | `left` | +| safe-area-inset-bottom`v4.1.6` | 是否开启 iphone 系列全面屏底部安全区适配 | boolean | `false` | +| cursor-spacing`v4.1.7` | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | number | 0 | ### Events -| 事件名 | 说明 | 回调参数 | -| ---------------- | ------------------- | ------------ | -| change | 输入内容时触发 | `val, event` | -| focus | 聚焦时触发 | `val, event` | -| blur | 失焦时触发 | `val, event` | -| clear | 点击清空时触发 | `val` | -| search | 按下 ENTER 键时触发 | `val, event` | -| click-input | 点击输入区域时触发 | `event` | -| click-left-icon | 点击左侧图标时触发 | `val, event` | -| click-right-icon | 点击右侧图标时触发 | `val, event` | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| change | 输入内容时触发 | `val, event` | +| focus | 聚焦时触发 | `val, event` | +| blur | 失焦时触发 | `val, event` | +| clear | 点击清空时触发 | `val` | +| search | 按下 ENTER 键时触发 | `val, event` | +| click-input | 点击输入区域时触发 | `event` | +| click-left-icon | 点击左侧图标时触发 | `val, event` | +| click-right-icon | 点击右侧图标时触发 | `val, event` | ### Slots -| 名称 | 说明 | -| -------- | ---------------- | -| leftin | 输入框内 左 icon | -| leftout | 输入框外 左 icon | -| rightin | 输入框内 右 icon | +| 名称 | 说明 | +| --- | --- | +| leftin | 输入框内 左 icon | +| leftout | 输入框外 左 icon | +| rightin | 输入框内 右 icon | | rightout | 输入框外 右 icon | ## 主题定制 @@ -296,17 +224,17 @@ app.use(Searchbar); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------------- | ------------------------------- | -| --nut-searchbar-background | _var(--nut-white)_ | -| --nut-searchbar-right-out-color | _var(--nut-black)_ | -| --nut-searchbar-padding | _9px 16px_ | -| --nut-searchbar-width | _100%_ | -| --nut-searchbar-input-background | _#f7f7f7_ | -| --nut-searchbar-input-padding | _0 0 0 13px_ | -| --nut-searchbar-input-height | _32px_ | -| --nut-searchbar-input-width | _100%_ | -| --nut-searchbar-input-border-radius | _16px_ | -| --nut-searchbar-input-box-shadow | _0 0 8px 0 rgba(0, 0, 0, 0.04)_ | -| --nut-searchbar-input-bar-color | _inherit_ | -| --nut-searchbar-input-bar-placeholder-color | _inherit_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-searchbar-background | _var(--nut-white)_ | +| --nut-searchbar-right-out-color | _var(--nut-black)_ | +| --nut-searchbar-padding | _9px 16px_ | +| --nut-searchbar-width | _100%_ | +| --nut-searchbar-input-background | _#f7f7f7_ | +| --nut-searchbar-input-padding | _0 0 0 13px_ | +| --nut-searchbar-input-height | _32px_ | +| --nut-searchbar-input-width | _100%_ | +| --nut-searchbar-input-border-radius | _16px_ | +| --nut-searchbar-input-box-shadow | _0 0 8px 0 rgba(0, 0, 0, 0.04)_ | +| --nut-searchbar-input-bar-color | _inherit_ | +| --nut-searchbar-input-bar-placeholder-color | _inherit_ | diff --git a/src/packages/__VUE/shortpassword/demo.vue b/src/packages/__VUE/shortpassword/demo.vue index 83ede6a8da..33129a06ee 100644 --- a/src/packages/__VUE/shortpassword/demo.vue +++ b/src/packages/__VUE/shortpassword/demo.vue @@ -77,8 +77,8 @@ - - - diff --git a/src/packages/__VUE/shortpassword/doc.en-US.md b/src/packages/__VUE/shortpassword/doc.en-US.md index 8a41d9332c..2799ddf4d4 100644 --- a/src/packages/__VUE/shortpassword/doc.en-US.md +++ b/src/packages/__VUE/shortpassword/doc.en-US.md @@ -6,7 +6,7 @@ Short password input box, which can be used to enter passwords, SMS verification ### Install -```javascript +```js import { createApp } from 'vue'; import { ShortPassword, NumberKeyboard } from '@nutui/nutui'; @@ -19,28 +19,21 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -50,9 +43,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -96,9 +80,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -144,9 +119,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -194,24 +160,24 @@ app.use(NumberKeyboard); ### Props -| Attribute | Description | Type | Default | -| ---------------------- | ------------------------------------- | ---------------- | ------------------------- | -| v-model | Current value | string | | -| v-model:visible | Whether to show shortpassword | boolean | `false` | -| title | title | string | `Please enter password ` | -| desc | description | string | `Verify` | -| tips | Bottom right prompt | string | `Forget password ` | -| close-on-click-overlay | Click to close the mask | boolean | `true` | -| length | ShortPassword lenght The value is 4~6 | string \| number | `6` | -| error-msg | Error message | string | `''` | +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| v-model | Current value | string | | +| v-model:visible | Whether to show shortpassword | boolean | `false` | +| title | title | string | `Please enter password ` | +| desc | description | string | `Verify` | +| tips | Bottom right prompt | string | `Forget password ` | +| close-on-click-overlay | Click to close the mask | boolean | `true` | +| length | ShortPassword lenght The value is 4~6 | string \| number | `6` | +| error-msg | Error message | string | `''` | ### Events -| Event | Description | Arguments | -| -------- | ----------------------------------------------- | -------------- | -| close | Trigger an event when the close icon is clicked | - | -| complete | Input complete callback | `value:string` | -| focus | Emitted when input is focused | - | +| Event | Description | Arguments | +| --- | --- | --- | +| close | Trigger an event when the close icon is clicked | - | +| complete | Input complete callback | `value:string` | +| focus | Emitted when input is focused | - | ## Theming @@ -221,9 +187,9 @@ The component provides the following CSS variables, which can be used to customi | Name | Default Value | Description | -| 名称 | 默认值 | -| ------------------------------------ | -------------------------- | -| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | -| --nut-shortpassword-border-color | _#ddd_ | -| --nut-shortpassword-error | _var(--nut-primary-color)_ | -| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | +| --nut-shortpassword-border-color | _#ddd_ | +| --nut-shortpassword-error | _var(--nut-primary-color)_ | +| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | diff --git a/src/packages/__VUE/shortpassword/doc.md b/src/packages/__VUE/shortpassword/doc.md index 87c594029e..ea9a32ecbc 100644 --- a/src/packages/__VUE/shortpassword/doc.md +++ b/src/packages/__VUE/shortpassword/doc.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { ShortPassword, NumberKeyboard } from '@nutui/nutui'; @@ -19,28 +19,21 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -50,9 +43,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -96,9 +80,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -144,9 +119,9 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -194,24 +160,24 @@ app.use(NumberKeyboard); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ---------------------- | -------------------- | ---------------- | ------------------------------ | -| v-model | 密码初始值 | string | | -| v-model:visible | 是否展示短密码框 | boolean | `false` | -| title | 标题 | string | `请输入密码` | -| desc | 密码框描述 | string | `您使用了虚拟资产,请进行验证` | -| tips | 提示语 | string | `忘记密码` | -| close-on-click-overlay | 是否点击遮罩关闭 | boolean | `true` | -| length | 密码长度,取值为 4~6 | string \| number | `6` | -| error-msg | 错误信息提示 | string | `''` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 密码初始值 | string | | +| v-model:visible | 是否展示短密码框 | boolean | `false` | +| title | 标题 | string | `请输入密码` | +| desc | 密码框描述 | string | `您使用了虚拟资产,请进行验证` | +| tips | 提示语 | string | `忘记密码` | +| close-on-click-overlay | 是否点击遮罩关闭 | boolean | `true` | +| length | 密码长度,取值为 4~6 | string \| number | `6` | +| error-msg | 错误信息提示 | string | `''` | ### Events -| 事件名 | 说明 | 回调参数 | -| -------- | ---------------------- | -------------- | -| close | 点击关闭图标时触发事件 | - | -| complete | 输入完成的回调 | `value:string` | -| focus | 输入框聚焦时触发 | - | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| close | 点击关闭图标时触发事件 | - | +| complete | 输入完成的回调 | `value:string` | +| focus | 输入框聚焦时触发 | - | ## 主题定制 @@ -219,9 +185,9 @@ app.use(NumberKeyboard); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------ | -------------------------- | -| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | -| --nut-shortpassword-border-color | _#ddd_ | -| --nut-shortpassword-error | _var(--nut-primary-color)_ | -| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | +| --nut-shortpassword-border-color | _#ddd_ | +| --nut-shortpassword-error | _var(--nut-primary-color)_ | +| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | diff --git a/src/packages/__VUE/shortpassword/doc.taro.md b/src/packages/__VUE/shortpassword/doc.taro.md index 7bf264e559..61479a0237 100644 --- a/src/packages/__VUE/shortpassword/doc.taro.md +++ b/src/packages/__VUE/shortpassword/doc.taro.md @@ -6,7 +6,7 @@ ### 安装 -```javascript +```js import { createApp } from 'vue'; import { ShortPassword, NumberKeyboard } from '@nutui/nutui-taro'; @@ -19,32 +19,21 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -54,48 +43,34 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -105,45 +80,36 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -153,47 +119,38 @@ app.use(NumberKeyboard); :::demo -```html +```vue - ``` @@ -203,24 +160,24 @@ app.use(NumberKeyboard); ### Props -| 参数 | 说明 | 类型 | 默认值 | -| ---------------------- | -------------------- | ---------------- | ------------------------------ | -| v-model | 密码初始值 | string | | -| v-model:visible | 是否展示短密码框 | boolean | `false` | -| title | 标题 | string | `请输入密码` | -| desc | 密码框描述 | string | `您使用了虚拟资产,请进行验证` | -| tips | 提示语 | string | `忘记密码` | -| close-on-click-overlay | 是否点击遮罩关闭 | boolean | `true` | -| length | 密码长度,取值为 4~6 | string \| number | `6` | -| error-msg | 错误信息提示 | string | `''` | +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| v-model | 密码初始值 | string | | +| v-model:visible | 是否展示短密码框 | boolean | `false` | +| title | 标题 | string | `请输入密码` | +| desc | 密码框描述 | string | `您使用了虚拟资产,请进行验证` | +| tips | 提示语 | string | `忘记密码` | +| close-on-click-overlay | 是否点击遮罩关闭 | boolean | `true` | +| length | 密码长度,取值为 4~6 | string \| number | `6` | +| error-msg | 错误信息提示 | string | `''` | ### Events -| 事件名 | 说明 | 回调参数 | -| -------- | ------------------------------ | -------------- | -| close | 点击关闭图标或者遮罩时触发事件 | - | -| complete | 输入完成的回调 | `value:string` | -| focus | 输入框聚焦时触发 | - | +| 事件名 | 说明 | 回调参数 | +| --- | --- | --- | +| close | 点击关闭图标或者遮罩时触发事件 | - | +| complete | 输入完成的回调 | `value:string` | +| focus | 输入框聚焦时触发 | - | ## 主题定制 @@ -228,9 +185,9 @@ app.use(NumberKeyboard); 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/component/configprovider)。 -| 名称 | 默认值 | -| ------------------------------------ | -------------------------- | -| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | -| --nut-shortpassword-border-color | _#ddd_ | -| --nut-shortpassword-error | _var(--nut-primary-color)_ | -| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | +| 名称 | 默认值 | +| --- | --- | +| --nut-shortpassword-background-color | _rgba(245, 245, 245, 1)_ | +| --nut-shortpassword-border-color | _#ddd_ | +| --nut-shortpassword-error | _var(--nut-primary-color)_ | +| --nut-shortpassword-forget | _rgba(128, 128, 128, 1)_ | diff --git a/src/packages/__VUE/textarea/demo.vue b/src/packages/__VUE/textarea/demo.vue index 06577257cd..b3f7317a50 100644 --- a/src/packages/__VUE/textarea/demo.vue +++ b/src/packages/__VUE/textarea/demo.vue @@ -15,8 +15,8 @@ - diff --git a/src/packages/__VUE/uploader/demo.vue b/src/packages/__VUE/uploader/demo.vue index a29085fe97..81e805fd57 100644 --- a/src/packages/__VUE/uploader/demo.vue +++ b/src/packages/__VUE/uploader/demo.vue @@ -46,8 +46,8 @@ - diff --git a/src/packages/__VUE/uploader/doc.en-US.md b/src/packages/__VUE/uploader/doc.en-US.md index 3ab000b8ee..b2a6701766 100644 --- a/src/packages/__VUE/uploader/doc.en-US.md +++ b/src/packages/__VUE/uploader/doc.en-US.md @@ -6,7 +6,7 @@ Used to upload local pictures or files to the server. ### Install -```javascript +```js import { createApp } from 'vue'; import { Uploader } from '@nutui/nutui'; @@ -18,7 +18,7 @@ app.use(Uploader); :::demo -```html +```vue @@ -30,44 +30,36 @@ app.use(Uploader); :::demo -```html +```vue - ``` @@ -77,46 +69,38 @@ app.use(Uploader); :::demo -```html +```vue - ``` @@ -126,7 +110,7 @@ app.use(Uploader); :::demo -```html +```vue