From 26a0f6a8670ca33c589a1d3c34d1707ea60cd711 Mon Sep 17 00:00:00 2001 From: Eiinu Date: Sat, 23 Dec 2023 21:50:05 +0800 Subject: [PATCH] chore(collapse): split demo --- .../exhibition/pages/collapse/accordion.vue | 14 ++ .../src/exhibition/pages/collapse/basic.vue | 11 ++ .../src/exhibition/pages/collapse/custom.vue | 12 ++ .../src/exhibition/pages/collapse/data.vue | 14 ++ .../exhibition/pages/collapse/disabled.vue | 7 + .../src/exhibition/pages/collapse/extra.vue | 9 ++ .../src/exhibition/pages/collapse/index.vue | 96 +++++------ src/packages/__VUE/collapse/demo.vue | 143 ----------------- .../__VUE/collapse/demo/accordion.vue | 14 ++ src/packages/__VUE/collapse/demo/basic.vue | 11 ++ src/packages/__VUE/collapse/demo/custom.vue | 12 ++ src/packages/__VUE/collapse/demo/data.vue | 14 ++ src/packages/__VUE/collapse/demo/disabled.vue | 7 + src/packages/__VUE/collapse/demo/extra.vue | 9 ++ src/packages/__VUE/collapse/demo/index.vue | 49 ++++++ src/packages/__VUE/collapse/doc.en-US.md | 150 +++--------------- src/packages/__VUE/collapse/doc.md | 130 ++------------- src/packages/__VUE/collapse/doc.taro.md | 130 ++------------- 18 files changed, 284 insertions(+), 548 deletions(-) create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/accordion.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/basic.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/custom.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/data.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/disabled.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/collapse/extra.vue delete mode 100644 src/packages/__VUE/collapse/demo.vue create mode 100644 src/packages/__VUE/collapse/demo/accordion.vue create mode 100644 src/packages/__VUE/collapse/demo/basic.vue create mode 100644 src/packages/__VUE/collapse/demo/custom.vue create mode 100644 src/packages/__VUE/collapse/demo/data.vue create mode 100644 src/packages/__VUE/collapse/demo/disabled.vue create mode 100644 src/packages/__VUE/collapse/demo/extra.vue create mode 100644 src/packages/__VUE/collapse/demo/index.vue diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/accordion.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/accordion.vue new file mode 100644 index 0000000000..fc045513ce --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/accordion.vue @@ -0,0 +1,14 @@ + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/basic.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/basic.vue new file mode 100644 index 0000000000..47b6d289d7 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/basic.vue @@ -0,0 +1,11 @@ + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/custom.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/custom.vue new file mode 100644 index 0000000000..480e82576d --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/custom.vue @@ -0,0 +1,12 @@ + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/data.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/data.vue new file mode 100644 index 0000000000..e2ee7edd43 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/data.vue @@ -0,0 +1,14 @@ + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/disabled.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/disabled.vue new file mode 100644 index 0000000000..9b42836d13 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/disabled.vue @@ -0,0 +1,7 @@ + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/extra.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/extra.vue new file mode 100644 index 0000000000..8d37c0e6ed --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/extra.vue @@ -0,0 +1,9 @@ + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/collapse/index.vue b/packages/nutui-taro-demo/src/exhibition/pages/collapse/index.vue index 64c8d6f10d..e7d841167a 100644 --- a/packages/nutui-taro-demo/src/exhibition/pages/collapse/index.vue +++ b/packages/nutui-taro-demo/src/exhibition/pages/collapse/index.vue @@ -1,61 +1,49 @@ diff --git a/src/packages/__VUE/collapse/demo.vue b/src/packages/__VUE/collapse/demo.vue deleted file mode 100644 index 105278856f..0000000000 --- a/src/packages/__VUE/collapse/demo.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - diff --git a/src/packages/__VUE/collapse/demo/accordion.vue b/src/packages/__VUE/collapse/demo/accordion.vue new file mode 100644 index 0000000000..fc045513ce --- /dev/null +++ b/src/packages/__VUE/collapse/demo/accordion.vue @@ -0,0 +1,14 @@ + + diff --git a/src/packages/__VUE/collapse/demo/basic.vue b/src/packages/__VUE/collapse/demo/basic.vue new file mode 100644 index 0000000000..47b6d289d7 --- /dev/null +++ b/src/packages/__VUE/collapse/demo/basic.vue @@ -0,0 +1,11 @@ + diff --git a/src/packages/__VUE/collapse/demo/custom.vue b/src/packages/__VUE/collapse/demo/custom.vue new file mode 100644 index 0000000000..e6301768e7 --- /dev/null +++ b/src/packages/__VUE/collapse/demo/custom.vue @@ -0,0 +1,12 @@ + + diff --git a/src/packages/__VUE/collapse/demo/data.vue b/src/packages/__VUE/collapse/demo/data.vue new file mode 100644 index 0000000000..e2ee7edd43 --- /dev/null +++ b/src/packages/__VUE/collapse/demo/data.vue @@ -0,0 +1,14 @@ + + diff --git a/src/packages/__VUE/collapse/demo/disabled.vue b/src/packages/__VUE/collapse/demo/disabled.vue new file mode 100644 index 0000000000..9b42836d13 --- /dev/null +++ b/src/packages/__VUE/collapse/demo/disabled.vue @@ -0,0 +1,7 @@ + diff --git a/src/packages/__VUE/collapse/demo/extra.vue b/src/packages/__VUE/collapse/demo/extra.vue new file mode 100644 index 0000000000..8d37c0e6ed --- /dev/null +++ b/src/packages/__VUE/collapse/demo/extra.vue @@ -0,0 +1,9 @@ + diff --git a/src/packages/__VUE/collapse/demo/index.vue b/src/packages/__VUE/collapse/demo/index.vue new file mode 100644 index 0000000000..25ec6baa2f --- /dev/null +++ b/src/packages/__VUE/collapse/demo/index.vue @@ -0,0 +1,49 @@ + + diff --git a/src/packages/__VUE/collapse/doc.en-US.md b/src/packages/__VUE/collapse/doc.en-US.md index 9ca035a72c..235e5eac4a 100644 --- a/src/packages/__VUE/collapse/doc.en-US.md +++ b/src/packages/__VUE/collapse/doc.en-US.md @@ -17,135 +17,35 @@ app.use(CollapseItem); ### Basic Usage -Control the expanded panel list through 'V-model', and 'activenames' is in array format - -:::demo - -```vue - - -``` +The CollapseItem component must set the name property as a unique identifier. -::: - -### accordion - -You can set accordion mode through 'accordion', and expand up to one panel. At this time, 'activename' is in string format`value` you can set the content of a subtitle - -:::demo - -```vue - - -``` +> demo: collapse basic -::: - -### Custom collapse Icon - -Set custom icons through icon and rotate to set the rotation angle of icons - -:::demo - -```vue - - -``` +### v-model & onChange -::: - -### Set fixed content (do not collapse) - -Set content through slot: extra - -:::demo - -```vue - - -``` +The expanded CollapseItem can be controlled through `v-model`, which is an array type by default, where the value is the name attribute of the corresponding CollapseItem. + +> demo: collapse data + +### 手风琴 + +Accordion mode can be set through `accordion`, and up to one panel can be expanded. In this case, `v-model` is a single name. + +> demo: collapse accordion + +### 自定义折叠图标 + +Set a custom icon through the `slots.icon` or `props.icon` property. + +> demo: collapse custom + +### 禁用状态 + +> demo: collapse disabled + +### 设置固定内容(不折叠) -::: +> demo: collapse extra ## API diff --git a/src/packages/__VUE/collapse/doc.md b/src/packages/__VUE/collapse/doc.md index 1279c8070c..ac1d41360c 100644 --- a/src/packages/__VUE/collapse/doc.md +++ b/src/packages/__VUE/collapse/doc.md @@ -17,131 +17,35 @@ app.use(CollapseItem); ### 基础用法 -通过`v-model`控制展开的面板列表,`activeNames`为数组格式 -:::demo - -```vue - - -``` +CollapseItem 组件必须设置 name 属性作为唯一标识符。 + +> demo: collapse basic + +### 绑定数据与事件 -::: +通过 `v-model` 可以控制展开的 CollapseItem,默认情况下为数组类型,其中的值是对应 CollapseItem 的 name 属性。 + +> demo: collapse data ### 手风琴 -通过`accordion`可以设置为手风琴模式,最多展开一个面板,此时`activeName`为字符串格式;`value`可以设置右侧的内容 - -:::demo - -```vue - - -``` +通过 `accordion` 可以设置为手风琴模式,最多展开一个面板,此时 `v-model` 为单个 name。 -::: +> demo: collapse accordion ### 自定义折叠图标 -通过 icon 设置自定义图标 - -:::demo - -```vue - - -``` +通过 `slots.icon` 或者 `props.icon` 属性设置自定义图标 -::: +> demo: collapse custom -### 设置固定内容(不折叠) +### 禁用状态 -通过 slot:extra 设置内容 -:::demo - -```vue - - -``` +> demo: collapse disabled + +### 设置固定内容(不折叠) -::: +> demo: collapse extra ## API diff --git a/src/packages/__VUE/collapse/doc.taro.md b/src/packages/__VUE/collapse/doc.taro.md index 6ec5ca1e6a..d29b7b8cf5 100644 --- a/src/packages/__VUE/collapse/doc.taro.md +++ b/src/packages/__VUE/collapse/doc.taro.md @@ -17,131 +17,35 @@ app.use(CollapseItem); ### 基础用法 -通过`v-model`控制展开的面板列表,`activeNames`为数组格式 -:::demo - -```vue - - -``` +CollapseItem 组件必须设置 name 属性作为唯一标识符。 + +> demo: collapse basic exhibition + +### 绑定数据与事件 -::: +通过 `v-model` 可以控制展开的 CollapseItem,默认情况下为数组类型,其中的值是对应 CollapseItem 的 name 属性。 + +> demo: collapse data exhibition ### 手风琴 -通过`accordion`可以设置为手风琴模式,最多展开一个面板,此时`activeName`为字符串格式;`value`可以设置右侧的内容 - -:::demo - -```vue - - -``` +通过 `accordion` 可以设置为手风琴模式,最多展开一个面板,此时 `v-model` 为单个 name。 -::: +> demo: collapse accordion exhibition ### 自定义折叠图标 -通过 icon 设置自定义图标 - -:::demo - -```vue - - -``` +通过 `slots.icon` 或者 `props.icon` 属性设置自定义图标 -::: +> demo: collapse custom exhibition -### 设置固定内容(不折叠) +### 禁用状态 -通过 slot:extra 设置内容 -:::demo - -```vue - - -``` +> demo: collapse disabled exhibition + +### 设置固定内容(不折叠) -::: +> demo: collapse extra exhibition ## API