From 2f641f0a67cc2f3f262999fe30d50d659abffd8a Mon Sep 17 00:00:00 2001 From: Eiinu Date: Tue, 30 Jan 2024 15:21:04 +0800 Subject: [PATCH] chore(popup): split demo (#2899) --- .../src/basic/pages/popup/basic.vue | 8 + .../src/basic/pages/popup/close.vue | 27 ++++ .../src/basic/pages/popup/index.vue | 99 +++++------- .../src/basic/pages/popup/multi.vue | 12 ++ .../src/basic/pages/popup/position.vue | 20 +++ .../src/basic/pages/popup/round.vue | 8 + src/packages/__VUE/popup/demo.vue | 120 --------------- src/packages/__VUE/popup/demo/basic.vue | 8 + src/packages/__VUE/popup/demo/close.vue | 27 ++++ src/packages/__VUE/popup/demo/index.vue | 50 ++++++ src/packages/__VUE/popup/demo/multi.vue | 12 ++ src/packages/__VUE/popup/demo/port.vue | 10 ++ src/packages/__VUE/popup/demo/position.vue | 20 +++ src/packages/__VUE/popup/demo/round.vue | 8 + src/packages/__VUE/popup/doc.en-US.md | 145 ++---------------- src/packages/__VUE/popup/doc.md | 140 ++--------------- src/packages/__VUE/popup/doc.taro.md | 117 +------------- src/packages/__VUE/timeselect/doc.en-US.md | 1 - src/packages/__VUE/timeselect/doc.md | 1 - 19 files changed, 279 insertions(+), 554 deletions(-) create mode 100644 packages/nutui-taro-demo/src/basic/pages/popup/basic.vue create mode 100644 packages/nutui-taro-demo/src/basic/pages/popup/close.vue create mode 100644 packages/nutui-taro-demo/src/basic/pages/popup/multi.vue create mode 100644 packages/nutui-taro-demo/src/basic/pages/popup/position.vue create mode 100644 packages/nutui-taro-demo/src/basic/pages/popup/round.vue delete mode 100644 src/packages/__VUE/popup/demo.vue create mode 100644 src/packages/__VUE/popup/demo/basic.vue create mode 100644 src/packages/__VUE/popup/demo/close.vue create mode 100644 src/packages/__VUE/popup/demo/index.vue create mode 100644 src/packages/__VUE/popup/demo/multi.vue create mode 100644 src/packages/__VUE/popup/demo/port.vue create mode 100644 src/packages/__VUE/popup/demo/position.vue create mode 100644 src/packages/__VUE/popup/demo/round.vue diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/basic.vue b/packages/nutui-taro-demo/src/basic/pages/popup/basic.vue new file mode 100644 index 0000000000..50a71d1055 --- /dev/null +++ b/packages/nutui-taro-demo/src/basic/pages/popup/basic.vue @@ -0,0 +1,8 @@ + + diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/close.vue b/packages/nutui-taro-demo/src/basic/pages/popup/close.vue new file mode 100644 index 0000000000..d3ae643108 --- /dev/null +++ b/packages/nutui-taro-demo/src/basic/pages/popup/close.vue @@ -0,0 +1,27 @@ + + diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/index.vue b/packages/nutui-taro-demo/src/basic/pages/popup/index.vue index 2cd617ce67..765683f0d3 100644 --- a/packages/nutui-taro-demo/src/basic/pages/popup/index.vue +++ b/packages/nutui-taro-demo/src/basic/pages/popup/index.vue @@ -1,75 +1,46 @@ diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/multi.vue b/packages/nutui-taro-demo/src/basic/pages/popup/multi.vue new file mode 100644 index 0000000000..9d7d96ce54 --- /dev/null +++ b/packages/nutui-taro-demo/src/basic/pages/popup/multi.vue @@ -0,0 +1,12 @@ + + diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/position.vue b/packages/nutui-taro-demo/src/basic/pages/popup/position.vue new file mode 100644 index 0000000000..099ed410b2 --- /dev/null +++ b/packages/nutui-taro-demo/src/basic/pages/popup/position.vue @@ -0,0 +1,20 @@ + + diff --git a/packages/nutui-taro-demo/src/basic/pages/popup/round.vue b/packages/nutui-taro-demo/src/basic/pages/popup/round.vue new file mode 100644 index 0000000000..56e9569ad5 --- /dev/null +++ b/packages/nutui-taro-demo/src/basic/pages/popup/round.vue @@ -0,0 +1,8 @@ + + diff --git a/src/packages/__VUE/popup/demo.vue b/src/packages/__VUE/popup/demo.vue deleted file mode 100644 index b428df9d94..0000000000 --- a/src/packages/__VUE/popup/demo.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/src/packages/__VUE/popup/demo/basic.vue b/src/packages/__VUE/popup/demo/basic.vue new file mode 100644 index 0000000000..50a71d1055 --- /dev/null +++ b/src/packages/__VUE/popup/demo/basic.vue @@ -0,0 +1,8 @@ + + diff --git a/src/packages/__VUE/popup/demo/close.vue b/src/packages/__VUE/popup/demo/close.vue new file mode 100644 index 0000000000..d3ae643108 --- /dev/null +++ b/src/packages/__VUE/popup/demo/close.vue @@ -0,0 +1,27 @@ + + diff --git a/src/packages/__VUE/popup/demo/index.vue b/src/packages/__VUE/popup/demo/index.vue new file mode 100644 index 0000000000..c7c942a798 --- /dev/null +++ b/src/packages/__VUE/popup/demo/index.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/packages/__VUE/popup/demo/multi.vue b/src/packages/__VUE/popup/demo/multi.vue new file mode 100644 index 0000000000..9d7d96ce54 --- /dev/null +++ b/src/packages/__VUE/popup/demo/multi.vue @@ -0,0 +1,12 @@ + + diff --git a/src/packages/__VUE/popup/demo/port.vue b/src/packages/__VUE/popup/demo/port.vue new file mode 100644 index 0000000000..b1adadcd0c --- /dev/null +++ b/src/packages/__VUE/popup/demo/port.vue @@ -0,0 +1,10 @@ + + diff --git a/src/packages/__VUE/popup/demo/position.vue b/src/packages/__VUE/popup/demo/position.vue new file mode 100644 index 0000000000..099ed410b2 --- /dev/null +++ b/src/packages/__VUE/popup/demo/position.vue @@ -0,0 +1,20 @@ + + diff --git a/src/packages/__VUE/popup/demo/round.vue b/src/packages/__VUE/popup/demo/round.vue new file mode 100644 index 0000000000..56e9569ad5 --- /dev/null +++ b/src/packages/__VUE/popup/demo/round.vue @@ -0,0 +1,8 @@ + + diff --git a/src/packages/__VUE/popup/doc.en-US.md b/src/packages/__VUE/popup/doc.en-US.md index af4683ca8b..e199cdc54e 100644 --- a/src/packages/__VUE/popup/doc.en-US.md +++ b/src/packages/__VUE/popup/doc.en-US.md @@ -18,152 +18,35 @@ app.use(Popup); Control display/hide by setting `visible` -:::demo - -```vue - - -``` - -::: +> demo: popup basic -### Eject position +### Position Control the pop-up position by setting the value of `position` -:::demo - -```vue - - -``` - -::: +> demo: popup position -### Icon +### Close Icon The `closeable` controls whether the icon can be closed. The `close-icon-position` sets the position of the icon. The `close-icon` defines the display icon. -:::demo - -```vue - - -``` - -::: +> demo: popup close -### Rounded bullet frame +### Round Set `round` to control whether rounded corners are displayed -:::demo - -```vue - - -``` +> demo: popup round -::: +### Multi Layers -### Specify mount node +> demo: popup multi -Specify the mount node through `teleport` +### Teleport -:::demo +Use the [Teleport](https://vuejs.org/guide/built-ins/teleport.html) component provided by Vue to implement specified node mounting. -```vue - - -``` - -::: - -### Multi stack - -:::demo - -```vue - - -``` - -::: +> demo: popup port ## API @@ -185,11 +68,11 @@ const showPop2 = ref(false); | close-icon-position | Close button position(top-left,top-right,bottom-left,bottom-right) | string | `"top-right"` | | destroy-on-close | Will the contents of `slot` be cleared after the bullet layer is closed | boolean | `true` | | round | Show fillet | boolean | `false` | -| teleport | Specify the mount node | string | `"body"` | -| teleport-disable | Whether the node is allowed to be mounted, true means mount | boolean | `false` | | overlay-class | Custom mask class name | string | - | | overlay-style | Custom Mask Style | CSSProperties | - | | safe-area-inset-bottom | Whether to enable iPhone series full screen bottom safety zone adaptation, which is only valid when `position` is `bottom` | Boolean | `false` | +| teleport | Specify the mount node | string | `"body"` | +| teleport-disable | Whether the node is allowed to be mounted, true means mount | boolean | `false` | ### Events diff --git a/src/packages/__VUE/popup/doc.md b/src/packages/__VUE/popup/doc.md index 142f7f5a58..f1676d7476 100644 --- a/src/packages/__VUE/popup/doc.md +++ b/src/packages/__VUE/popup/doc.md @@ -18,149 +18,35 @@ app.use(Popup); 通过设置 `visible` 控制显示/隐藏 -:::demo - -```vue - - -``` - -::: +> demo: popup basic ### 弹出位置 通过设置 `position` 的值来控制弹出位置 -:::demo - -```vue - - -``` - -::: +> demo: popup position ### 图标 -通过 `closeable` 控制图标是否可关闭,`close-icon-position` 来设置图标的位置,`close-icon` 来自定义显示图标 - -:::demo - -```vue - - -``` +通过 `closeable` 控制图标是否可关闭,`close-icon-position` 来设置图标的位置,`close-icon` 插槽自定义显示图标 -::: +> demo: popup close ### 圆角弹框 通过设置 `round` 来控制是否显示圆角 -:::demo - -```vue - - -``` - -::: - -### 指定挂载节点 - -通过 `teleport` 来指定挂载节点 +> demo: popup round -:::demo - -```vue - - -``` +### 多层堆叠 -::: +> demo: popup multi -### 多层堆叠 +### 指定挂载节点 -:::demo - -```vue - - -``` +使用 Vue 提供的 [Teleport](https://cn.vuejs.org/guide/built-ins/teleport.html) 组件实现指定节点挂载。 -::: +> demo: popup port ## API @@ -182,11 +68,11 @@ const showPop2 = ref(false); | close-icon-position | 关闭按钮位置(top-left,top-right,bottom-left,bottom-right) | string | `"top-right"` | | destroy-on-close | 弹层关闭后 `slot`内容会不会清空 | boolean | `true` | | round | 是否显示圆角 | boolean | `false` | -| teleport | 指定挂载节点 | string | `"body"` | -| teleport-disable | 是否挂载节点,false 不挂载,true 挂载 | boolean | `false` | | overlay-class | 自定义遮罩层类名 | string | '' | | overlay-style | 自定义遮罩层样式 | string | '' | -| safe-area-inset-bottom | 是否开启 `iphone` 系列全面屏底部安全区适配,仅当 `position` 为 `bottom` 时有效 | boolean | `false` | +| safe-area-inset-bottom | 是否开启全面屏底部安全区适配,仅当 `position` 为 `bottom` 时有效 | boolean | `false` | +| teleport | 指定挂载节点 | string | `"body"` | +| teleport-disable | 是否挂载节点,false 不挂载,true 挂载 | boolean | `false` | ### Events diff --git a/src/packages/__VUE/popup/doc.taro.md b/src/packages/__VUE/popup/doc.taro.md index d447571bd3..7557d06818 100644 --- a/src/packages/__VUE/popup/doc.taro.md +++ b/src/packages/__VUE/popup/doc.taro.md @@ -18,132 +18,29 @@ app.use(Popup); 通过设置 `visible` 控制显示/隐藏 -:::demo - -```vue - - -``` - -::: +> demo: popup basic basic ### 弹出位置 通过设置 `position` 的值来控制弹出位置 -:::demo - -```vue - - -``` - -::: +> demo: popup position basic ### 图标 -通过 `closeable` 控制图标是否可关闭,`close-icon-position` 来设置图标的位置,`close-icon` 来自定义显示图标 +通过 `closeable` 控制图标是否可关闭,`close-icon-position` 来设置图标的位置,`close-icon` 插槽自定义显示图标 -:::demo - -```vue - - -``` - -::: +> demo: popup close basic ### 圆角弹框 通过设置 `round` 来控制是否显示圆角 -:::demo - -```vue - - -``` - -::: - -::: +> demo: popup round basic ### 多层堆叠 -:::demo - -```vue - - -``` - -::: +> demo: popup multi basic ### 禁止滚动穿透 @@ -197,7 +94,7 @@ const showPop2 = ref(false); | round | 是否显示圆角 | boolean | `false` | | overlay-class | 自定义遮罩层类名 | string | '' | | overlay-style | 自定义遮罩层样式 | string | '' | -| safe-area-inset-bottom | 是否开启 iphone 系列全面屏底部安全区适配,仅当 `position` 为 `bottom` 时有效 | boolean | `false` | +| safe-area-inset-bottom | 是否开启全面屏底部安全区适配,仅当 `position` 为 `bottom` 时有效 | boolean | `false` | ### Events diff --git a/src/packages/__VUE/timeselect/doc.en-US.md b/src/packages/__VUE/timeselect/doc.en-US.md index afa36cc216..5041c291bc 100644 --- a/src/packages/__VUE/timeselect/doc.en-US.md +++ b/src/packages/__VUE/timeselect/doc.en-US.md @@ -40,7 +40,6 @@ app.use(TimeDetail); | current-key | Unique identification | string \| number | `0` | | current-time | The currently selected time, the array element contains:key: string; list: string[] | Array | `[]` | | lock-scroll | Whether the background is locked | boolean | `true` | -| teleport-disable | Whether the node is allowed to be mounted | boolean | `false` | ### Slots diff --git a/src/packages/__VUE/timeselect/doc.md b/src/packages/__VUE/timeselect/doc.md index 8abc1497ad..633bb54ad7 100644 --- a/src/packages/__VUE/timeselect/doc.md +++ b/src/packages/__VUE/timeselect/doc.md @@ -40,7 +40,6 @@ app.use(TimeDetail); | current-key | 唯一标识 | string \| number | `0` | | current-time | 当前选择的时间,数组元素包含:key: string; list: string[] | Array | `[]` | | lock-scroll | 背景是否锁定 | boolean | `true` | -| teleport-disable | 是否允许挂载节点 | boolean | `false` | ### Slots