diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/basic.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/basic.vue new file mode 100644 index 0000000000..3d8523a655 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/basic.vue @@ -0,0 +1,11 @@ + + + Right + Left + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/disabled.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/disabled.vue new file mode 100644 index 0000000000..7d0450deb6 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/disabled.vue @@ -0,0 +1,11 @@ + + + checked + unchecked + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/event.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/event.vue new file mode 100644 index 0000000000..029638c15c --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/event.vue @@ -0,0 +1,12 @@ + + + Change + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/group-disabled.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/group-disabled.vue new file mode 100644 index 0000000000..26852c24fe --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/group-disabled.vue @@ -0,0 +1,14 @@ + + + + A + B + C + D + + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/group.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/group.vue new file mode 100644 index 0000000000..6c556f2649 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/group.vue @@ -0,0 +1,15 @@ + + + + A + B + C + D + + + {{ val }} + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/icon.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/icon.vue new file mode 100644 index 0000000000..66a541b5ac --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/icon.vue @@ -0,0 +1,14 @@ + + + + Icon + + + + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/indeterminate.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/indeterminate.vue new file mode 100644 index 0000000000..6742a9d107 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/indeterminate.vue @@ -0,0 +1,9 @@ + + + Indeterminate + + + 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 f22ae25b9e..66b667ee9a 100644 --- a/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/index.vue @@ -1,209 +1,85 @@ - - - 复选框 - - - 复选框 - - - - - 复选框 - - - - - 未选时禁用状态 - - - 选中时禁用状态 - - - - - 自定义尺寸25 - - - 自定义尺寸10 - - - - - 自定义图标 - - - - - - - - change复选框 - - - - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - 当前选中值 - {{ data.checkboxgroup1 }} - - - - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - - - - {{ - item.value - }} - - - - 全选 - 取消 - 反选 - - - - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - 当前选中值 - {{ data.checkboxgroup4 }} - - - - - 全选 - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - - - 按钮形状 - 按钮形状 - - - - - - - +}); + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/max.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/max.vue new file mode 100644 index 0000000000..ede505e89f --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/max.vue @@ -0,0 +1,14 @@ + + + + A + B + C + D + + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods.vue new file mode 100644 index 0000000000..67c7e063a7 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods.vue @@ -0,0 +1,44 @@ + + + + {{ + item.value + }} + + + + All + Cancel + Reverse + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods2.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods2.vue new file mode 100644 index 0000000000..ff66c99654 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/methods2.vue @@ -0,0 +1,36 @@ + + + State + + + + A + B + C + D + + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/shape.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/shape.vue new file mode 100644 index 0000000000..1332214cc6 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/shape.vue @@ -0,0 +1,11 @@ + + + Button + Button + + + diff --git a/packages/nutui-taro-demo/src/dentry/pages/checkbox/size.vue b/packages/nutui-taro-demo/src/dentry/pages/checkbox/size.vue new file mode 100644 index 0000000000..c1595fe7b8 --- /dev/null +++ b/packages/nutui-taro-demo/src/dentry/pages/checkbox/size.vue @@ -0,0 +1,11 @@ + + + size 25 + size 10 + + + diff --git a/src/packages/__VUE/checkbox/demo.vue b/src/packages/__VUE/checkbox/demo.vue deleted file mode 100644 index 6ae4138a2c..0000000000 --- a/src/packages/__VUE/checkbox/demo.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - {{ translate('checkbox') }} - - - - - {{ translate('checkbox') }} - - - - - - - {{ translate('checkbox') }} - - - - - - {{ translate('unselectDisable') }} - - - {{ translate('selectedDisable') }} - - - - - {{ translate('size') }}25 - - - {{ translate('size') }} 10 - - - - - - {{ translate('icon') }} - - - - - - - - - - - - change {{ translate('checkbox') }} - - - - - - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - - - - {{ translate('selected') }} - {{ state.checkboxgroup1 }} - - - - - - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - - - - - - - - {{ item.value }} - - - - - - {{ translate('selectAll') }} - - - {{ translate('cancel') }} - - {{ translate('selectReverse') }} - - - - - - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - {{ translate('combine') }} - - - - {{ translate('selected') }} - {{ state.checkboxgroup4 }} - - - - - {{ - translate('selectAll') - }} - - - - {{ translate('combine') }} - - {{ translate('combine') }} - - {{ translate('combine') }} - - {{ translate('combine') }} - - - - - - - {{ translate('useShape') }} - {{ translate('useShape') }} - - - - - - - diff --git a/src/packages/__VUE/checkbox/demo/basic.vue b/src/packages/__VUE/checkbox/demo/basic.vue new file mode 100644 index 0000000000..3d8523a655 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/basic.vue @@ -0,0 +1,11 @@ + + + Right + Left + + + diff --git a/src/packages/__VUE/checkbox/demo/disabled.vue b/src/packages/__VUE/checkbox/demo/disabled.vue new file mode 100644 index 0000000000..7d0450deb6 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/disabled.vue @@ -0,0 +1,11 @@ + + + checked + unchecked + + + diff --git a/src/packages/__VUE/checkbox/demo/event.vue b/src/packages/__VUE/checkbox/demo/event.vue new file mode 100644 index 0000000000..029638c15c --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/event.vue @@ -0,0 +1,12 @@ + + + Change + + + diff --git a/src/packages/__VUE/checkbox/demo/group-disabled.vue b/src/packages/__VUE/checkbox/demo/group-disabled.vue new file mode 100644 index 0000000000..26852c24fe --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/group-disabled.vue @@ -0,0 +1,14 @@ + + + + A + B + C + D + + + + diff --git a/src/packages/__VUE/checkbox/demo/group.vue b/src/packages/__VUE/checkbox/demo/group.vue new file mode 100644 index 0000000000..6c556f2649 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/group.vue @@ -0,0 +1,15 @@ + + + + A + B + C + D + + + {{ val }} + + diff --git a/src/packages/__VUE/checkbox/demo/icon.vue b/src/packages/__VUE/checkbox/demo/icon.vue new file mode 100644 index 0000000000..29e4ac604e --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/icon.vue @@ -0,0 +1,14 @@ + + + + Icon + + + + + + diff --git a/src/packages/__VUE/checkbox/demo/indeterminate.vue b/src/packages/__VUE/checkbox/demo/indeterminate.vue new file mode 100644 index 0000000000..6742a9d107 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/indeterminate.vue @@ -0,0 +1,9 @@ + + + Indeterminate + + + diff --git a/src/packages/__VUE/checkbox/demo/index.vue b/src/packages/__VUE/checkbox/demo/index.vue new file mode 100644 index 0000000000..8accf72d8c --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/index.vue @@ -0,0 +1,85 @@ + + + {{ t('basic') }} + + + {{ t('indeterminate') }} + + + {{ t('disabled') }} + + + {{ t('size') }} + + + {{ t('icon') }} + + + {{ t('event') }} + + + {{ t('group') }} + + + {{ t('groupDisabled') }} + + + {{ t('methods') }} + + + {{ t('max') }} + + + {{ t('methods2') }} + + + {{ t('shape') }} + + + + diff --git a/src/packages/__VUE/checkbox/demo/max.vue b/src/packages/__VUE/checkbox/demo/max.vue new file mode 100644 index 0000000000..ede505e89f --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/max.vue @@ -0,0 +1,14 @@ + + + + A + B + C + D + + + + diff --git a/src/packages/__VUE/checkbox/demo/methods.vue b/src/packages/__VUE/checkbox/demo/methods.vue new file mode 100644 index 0000000000..67c7e063a7 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/methods.vue @@ -0,0 +1,44 @@ + + + + {{ + item.value + }} + + + + All + Cancel + Reverse + + + diff --git a/src/packages/__VUE/checkbox/demo/methods2.vue b/src/packages/__VUE/checkbox/demo/methods2.vue new file mode 100644 index 0000000000..ff66c99654 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/methods2.vue @@ -0,0 +1,36 @@ + + + State + + + + A + B + C + D + + + + diff --git a/src/packages/__VUE/checkbox/demo/shape.vue b/src/packages/__VUE/checkbox/demo/shape.vue new file mode 100644 index 0000000000..1332214cc6 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/shape.vue @@ -0,0 +1,11 @@ + + + Button + Button + + + diff --git a/src/packages/__VUE/checkbox/demo/size.vue b/src/packages/__VUE/checkbox/demo/size.vue new file mode 100644 index 0000000000..c1595fe7b8 --- /dev/null +++ b/src/packages/__VUE/checkbox/demo/size.vue @@ -0,0 +1,11 @@ + + + size 25 + size 10 + + + diff --git a/src/packages/__VUE/checkbox/doc.en-US.md b/src/packages/__VUE/checkbox/doc.en-US.md index 3041eeca52..2fa6872be0 100644 --- a/src/packages/__VUE/checkbox/doc.en-US.md +++ b/src/packages/__VUE/checkbox/doc.en-US.md @@ -17,300 +17,55 @@ app.use(CheckboxGroup); ### Basic Usage -:::demo - -```vue - - check box - check box - - - -``` - -::: - -### Semi selective +> demo: checkbox basic -:::demo +### Indeterminate -```vue - - - check box - - - -``` - -::: +> demo: checkbox indeterminate -### Disabled state +### Disabled -:::demo +> demo: checkbox disabled -```vue - - Disabled when not selected - Disabled when selected - - -``` +### Custom Size -::: +> demo: checkbox size -### Custom size +### Custom Icon -:::demo - -```vue - - Custom size 25 - Custom size 10 - - -``` - -::: +Customize the icon through the slot, it is recommended to set the `icon` and `checkedIcon` two slots at the same time -### Custom icon +> demo: checkbox icon -Customize the icon through the slot, it is recommended to set the `icon` and `checkedIcon` two slots at the same time +### Change Event -:::demo - -```vue - - - Custom icon - - - - - -``` +When the value changes, the `change` event will be triggered -::: +> demo: checkbox event -### change Event +### CheckboxGroup -When the value changes, the `change` event will be triggered +> demo: checkbox group -:::demo - -```vue - - change check box - - -``` +### Disabled CheckboxGroup -::: - -### use checkboxGroup - -:::demo - -```vue - - - Combined check box - Combined check box - Combined check box - Combined check box - - - Currently selected value - {{ checkboxgroup1 }} - - - -``` +> demo: checkbox group-disabled -::: - -### checkboxGroup disabled - -:::demo - -```vue - - - Combined check box - Combined check box - Combined check box - Combined check box - - - Currently selected value - {{ checkboxgroup1 }} - - - -``` +### CheckboxGroup Methods -::: - -### Checkboxgroup select all / cancel - -:::demo - -```vue - - - {{ item.value }} - - - Select all - cancel - reverse selection - - - -``` +> demo: checkbox methods -::: - -### use checkboxGroup, Limit the maximum number of options (2) - -:::demo - -```vue - - - - - Combined check box - Combined check box - Combined check box - Combined check box - - - - selected - {{ checkboxgroup4 }} - - - - -``` +### CheckboxGroup Limit the maximum number of options -::: +> demo: checkbox max ### Select all / half / cancel -:::demo - -```vue - - - - selectAll - - - Combined check box - Combined check box - Combined check box - Combined check box - - - - -``` +> demo: checkbox methods + +### Button Shape -::: +> demo: checkbox shape ## API diff --git a/src/packages/__VUE/checkbox/doc.md b/src/packages/__VUE/checkbox/doc.md index 6a78832394..9a731402cb 100644 --- a/src/packages/__VUE/checkbox/doc.md +++ b/src/packages/__VUE/checkbox/doc.md @@ -17,304 +17,55 @@ app.use(CheckboxGroup); ### 基础用法 -:::demo - -```vue - - 复选框 - 复选框 - - - -``` - -::: +> demo: checkbox basic ### 半选状态 -:::demo - -```vue - - - 复选框 - - - -``` - -::: +> demo: checkbox indeterminate ### 禁用状态 -:::demo - -```vue - - 未选时禁用状态 - 选中时禁用状态 - - -``` - -::: +> demo: checkbox disabled ### 自定义尺寸 -:::demo - -```vue - - 自定义尺寸25 - 自定义尺寸10 - - -``` - -::: +> demo: checkbox size ### 自定义图标 -通过 slot 自定义图标,建议同时设置`icon`和`checkedIcon`两个插槽 - -:::demo - -```vue - - - 自定义图标 - - - - - -``` +通过 slot 自定义图标,建议同时设置 `icon` 和 `checkedIcon` 两个插槽 -::: +> demo: checkbox icon -### change 事件 +### Change 事件 值发生变化时,将触发 `change` 事件 -:::demo - -```vue - - change复选框 - - -``` +> demo: checkbox event -::: - -### checkboxGroup 使用 - -:::demo - -```vue - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - 当前选中值 - {{ checkboxgroup1 }} - - - -``` +### CheckboxGroup -::: - -### checkboxGroup 禁用 - -:::demo - -```vue - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - 当前选中值 - {{ checkboxgroup1 }} - - - -``` +> demo: checkbox group -::: - -### checkboxGroup 全选/取消 - -:::demo - -```vue - - - {{ - item.value - }} - - - 全选 - 取消 - 反选 - - - -``` +### CheckboxGroup 禁用 -::: - -### checkboxGroup 使用,限制最大可选数(2 个) - -:::demo - -```vue - - - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - 选中 - {{ checkboxgroup4 }} - - - - -``` +> demo: checkbox group-disabled + +### CheckboxGroup 方法 -::: +> demo: checkbox methods + +### CheckboxGroup 限制最大可选数 + +> demo: checkbox max ### 全选/半选/取消 -:::demo - -```vue - - - - 全选 - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - -``` +> demo: checkbox methods2 + +### 按钮形状 -::: +> demo: checkbox shape ## API diff --git a/src/packages/__VUE/checkbox/doc.taro.md b/src/packages/__VUE/checkbox/doc.taro.md index 9be9b92b04..8e50d90d00 100644 --- a/src/packages/__VUE/checkbox/doc.taro.md +++ b/src/packages/__VUE/checkbox/doc.taro.md @@ -17,304 +17,55 @@ app.use(CheckboxGroup); ### 基础用法 -:::demo - -```vue - - 复选框 - 复选框 - - - -``` - -::: +> demo: checkbox basic dentry ### 半选状态 -:::demo - -```vue - - - 复选框 - - - -``` - -::: +> demo: checkbox indeterminate dentry ### 禁用状态 -:::demo - -```vue - - 未选时禁用状态 - 选中时禁用状态 - - -``` - -::: +> demo: checkbox disabled dentry ### 自定义尺寸 -:::demo - -```vue - - 自定义尺寸25 - 自定义尺寸10 - - -``` - -::: +> demo: checkbox size dentry ### 自定义图标 -通过 slot 自定义图标,建议同时设置`icon`和`checkedIcon`两个插槽 - -:::demo - -```vue - - - 自定义图标 - - - - - -``` +通过 slot 自定义图标,建议同时设置 `icon` 和 `checkedIcon` 两个插槽 -::: +> demo: checkbox icon dentry -### change 事件 +### Change 事件 值发生变化时,将触发 `change` 事件 -:::demo - -```vue - - change复选框 - - -``` +> demo: checkbox event dentry -::: - -### checkboxGroup 使用 - -:::demo - -```vue - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - 当前选中值 - {{ checkboxgroup1 }} - - - -``` +### CheckboxGroup -::: - -### checkboxGroup 禁用 - -:::demo - -```vue - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - 当前选中值 - {{ checkboxgroup1 }} - - - -``` +> demo: checkbox group dentry -::: - -### checkboxGroup 全选/取消 - -:::demo - -```vue - - - {{ - item.value - }} - - - 全选 - 取消 - 反选 - - - -``` +### CheckboxGroup 禁用 -::: - -### checkboxGroup 使用,限制最大可选数(2 个) - -:::demo - -```vue - - - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - 选中 - {{ checkboxgroup4 }} - - - - -``` +> demo: checkbox group-disabled dentry + +### CheckboxGroup 方法 -::: +> demo: checkbox methods dentry + +### CheckboxGroup 限制最大可选数 + +> demo: checkbox max dentry ### 全选/半选/取消 -:::demo - -```vue - - - - 全选 - - - 组合复选框 - 组合复选框 - 组合复选框 - 组合复选框 - - - - -``` +> demo: checkbox methods2 dentry + +### 按钮形状 -::: +> demo: checkbox shape dentry ## API