From e8fe16bd8e104cc457b5c445b2ade09dd284e9e3 Mon Sep 17 00:00:00 2001 From: Eiinu Date: Mon, 29 Jan 2024 17:21:49 +0800 Subject: [PATCH] chore(tour): split demo (#2893) --- .../src/exhibition/pages/tour/basic.vue | 19 ++ .../src/exhibition/pages/tour/content.vue | 43 +++ .../src/exhibition/pages/tour/custom.vue | 31 ++ .../src/exhibition/pages/tour/index.vue | 266 ++-------------- .../src/exhibition/pages/tour/position.vue | 39 +++ .../src/exhibition/pages/tour/step.vue | 43 +++ src/packages/__VUE/tour/demo.vue | 284 ------------------ src/packages/__VUE/tour/demo/basic.vue | 19 ++ src/packages/__VUE/tour/demo/content.vue | 43 +++ src/packages/__VUE/tour/demo/custom.vue | 31 ++ src/packages/__VUE/tour/demo/index.vue | 43 +++ src/packages/__VUE/tour/demo/position.vue | 39 +++ src/packages/__VUE/tour/demo/step.vue | 43 +++ src/packages/__VUE/tour/doc.en-US.md | 248 +-------------- src/packages/__VUE/tour/doc.md | 254 +--------------- src/packages/__VUE/tour/doc.taro.md | 266 +--------------- 16 files changed, 453 insertions(+), 1258 deletions(-) create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/tour/basic.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/tour/content.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/tour/custom.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/tour/position.vue create mode 100644 packages/nutui-taro-demo/src/exhibition/pages/tour/step.vue delete mode 100644 src/packages/__VUE/tour/demo.vue create mode 100644 src/packages/__VUE/tour/demo/basic.vue create mode 100644 src/packages/__VUE/tour/demo/content.vue create mode 100644 src/packages/__VUE/tour/demo/custom.vue create mode 100644 src/packages/__VUE/tour/demo/index.vue create mode 100644 src/packages/__VUE/tour/demo/position.vue create mode 100644 src/packages/__VUE/tour/demo/step.vue diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/basic.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/basic.vue new file mode 100644 index 0000000000..201245b7e6 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/basic.vue @@ -0,0 +1,19 @@ + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/content.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/content.vue new file mode 100644 index 0000000000..0cd96df764 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/content.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/custom.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/custom.vue new file mode 100644 index 0000000000..a907a33e8f --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/custom.vue @@ -0,0 +1,31 @@ + + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/index.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/index.vue index cdb3182e6a..171671a183 100644 --- a/packages/nutui-taro-demo/src/exhibition/pages/tour/index.vue +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/index.vue @@ -1,245 +1,43 @@ - diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/position.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/position.vue new file mode 100644 index 0000000000..a683786e1a --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/position.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/packages/nutui-taro-demo/src/exhibition/pages/tour/step.vue b/packages/nutui-taro-demo/src/exhibition/pages/tour/step.vue new file mode 100644 index 0000000000..6b364c4155 --- /dev/null +++ b/packages/nutui-taro-demo/src/exhibition/pages/tour/step.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/packages/__VUE/tour/demo.vue b/src/packages/__VUE/tour/demo.vue deleted file mode 100644 index 98696914ea..0000000000 --- a/src/packages/__VUE/tour/demo.vue +++ /dev/null @@ -1,284 +0,0 @@ - - - diff --git a/src/packages/__VUE/tour/demo/basic.vue b/src/packages/__VUE/tour/demo/basic.vue new file mode 100644 index 0000000000..201245b7e6 --- /dev/null +++ b/src/packages/__VUE/tour/demo/basic.vue @@ -0,0 +1,19 @@ + + diff --git a/src/packages/__VUE/tour/demo/content.vue b/src/packages/__VUE/tour/demo/content.vue new file mode 100644 index 0000000000..0cd96df764 --- /dev/null +++ b/src/packages/__VUE/tour/demo/content.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/packages/__VUE/tour/demo/custom.vue b/src/packages/__VUE/tour/demo/custom.vue new file mode 100644 index 0000000000..a907a33e8f --- /dev/null +++ b/src/packages/__VUE/tour/demo/custom.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/packages/__VUE/tour/demo/index.vue b/src/packages/__VUE/tour/demo/index.vue new file mode 100644 index 0000000000..de24a2ad31 --- /dev/null +++ b/src/packages/__VUE/tour/demo/index.vue @@ -0,0 +1,43 @@ + + diff --git a/src/packages/__VUE/tour/demo/position.vue b/src/packages/__VUE/tour/demo/position.vue new file mode 100644 index 0000000000..a683786e1a --- /dev/null +++ b/src/packages/__VUE/tour/demo/position.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/packages/__VUE/tour/demo/step.vue b/src/packages/__VUE/tour/demo/step.vue new file mode 100644 index 0000000000..6b364c4155 --- /dev/null +++ b/src/packages/__VUE/tour/demo/step.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/packages/__VUE/tour/doc.en-US.md b/src/packages/__VUE/tour/doc.en-US.md index 963da55f27..84c3259e60 100644 --- a/src/packages/__VUE/tour/doc.en-US.md +++ b/src/packages/__VUE/tour/doc.en-US.md @@ -18,265 +18,29 @@ app.use(Tour); At each step, set the id of the target element, and the Tour component looks up the set id value -:::demo - -```vue - - - -``` - -::: +> demo: tour basic ### Custom Style -Through 'maskWidth', 'maskHeight', 'bgColor' can be configured hollow mask size, bubble shell layer background color - -:::demo +Through 'mask-width', 'mask-height', 'bg-color' can be configured hollow mask size, bubble shell layer background color -```vue - - - - -``` - -::: +> demo: tour custom ### Custom Offset 'offset' sets the distance of the hollow mask relative to the target element, 'popoverOffset' sets the offset of the bubble layer -:::demo - -```vue - - - - - -``` - -::: +> demo: tour position ### Custom Content Can customize the bubble layer through the slot slot -:::demo - -```vue - - - - - -``` - -::: +> demo: tour content ### Steps -:::demo - -```vue - - - - - -``` - -::: +> demo: tour step ## API diff --git a/src/packages/__VUE/tour/doc.md b/src/packages/__VUE/tour/doc.md index b96eeceb5e..f179c7638d 100644 --- a/src/packages/__VUE/tour/doc.md +++ b/src/packages/__VUE/tour/doc.md @@ -18,265 +18,31 @@ app.use(Tour); 在每一步中设置 `target` 目标元素的 id ,Tour 组件则会根据设置的 id 值进行查找 -:::demo - -```vue - - - -``` - -::: +> demo: tour basic ### 自定义样式 -通过 `maskWidth`、`maskHeight`、`bgColor` 可配置镂空遮罩的大小、气泡弹层背景色 - -:::demo - -```vue - +通过 `mask-width`、`mask-height`、`bg-color` 可配置镂空遮罩的大小、气泡弹层背景色 - - -``` - -::: +> demo: tour custom ### 设置偏移量 `offset` 可设置镂空遮罩层相对于目标元素的距离,`popoverOffset` 可设置气泡层的偏移量 -:::demo - -```vue - - - - -``` - -::: +> demo: tour position ### 自定义内容 通过 slot 插槽可自定义气泡层内容 -:::demo - -```vue - - - - - -``` - -::: +> demo: tour content ### 步骤引导 属性 `type` 设置为 `step` 可以进行步骤操作。属性 `Steps` 数组中的每一项代表每步的内容 -:::demo - -```vue - - - - -``` - -::: +> demo: tour step ## API @@ -290,12 +56,12 @@ const state = reactive({ | offset | 镂空遮罩相对于目标元素的偏移量 | [number, number] | `[8, 10]` | | current | 类型为 `step` 时,默认展示第几步 | number | `0` | | custom-class | 自定义 class 值 | string | '' | -| location | 弹出层位置,同 Popopver 的[location 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | 'bottom' | -| next-step-Txt | 下一步按钮文案 | string | `'下一步'` | -| prev-step-Txt | 上一步按钮文案 | string | `'上一步' ` | +| location | 弹出层位置,同 Popopver 的[location 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | `bottom` | +| next-step-Txt | 下一步按钮文案 | string | `下一步` | +| prev-step-Txt | 上一步按钮文案 | string | `上一步` | | complete-txt | 完成按钮文案 | string | `'完成'` | | mask | 是否显示镂空遮罩 | boolean | `true` | -| bg-color | 自定义背景色 | boolean | `''` | +| bg-color | 自定义背景色 | boolean | - | | theme | 气泡遮罩层主题,同 Popopver 的[theme 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | `'light'` | | mask-width | 镂空遮罩层宽度 | number \| string | '' | | mask-height | 镂空遮罩层高度 | number \| string | '' | diff --git a/src/packages/__VUE/tour/doc.taro.md b/src/packages/__VUE/tour/doc.taro.md index 720b01a7e7..8f61820907 100644 --- a/src/packages/__VUE/tour/doc.taro.md +++ b/src/packages/__VUE/tour/doc.taro.md @@ -18,273 +18,31 @@ app.use(Tour); 在每一步中设置 `target` 目标元素的 id ,Tour 组件则会根据设置的 id 值进行查找 -:::demo - -```vue - - - - -``` - -::: +> demo: tour basic exhibition ### 自定义样式 -通过 `maskWidth`、`maskHeight`、`bgColor` 可配置镂空遮罩的大小、气泡弹层背景色 - -:::demo - -```vue - +通过 `mask-width`、`mask-height`、`bg-color` 可配置镂空遮罩的大小、气泡弹层背景色 - - - -``` - -::: +> demo: tour custom exhibition ### 设置偏移量 `offset` 可设置镂空遮罩层相对于目标元素的距离,`popoverOffset` 可设置气泡层的偏移量 -:::demo - -```vue - - - - - -``` - -::: +> demo: tour position exhibition ### 自定义内容 通过 slot 插槽可自定义气泡层内容 -:::demo - -```vue - - - - -``` - -::: +> demo: tour content exhibition ### 步骤引导 属性 `type` 设置为 `step` 可以进行步骤操作。属性 `Steps` 数组中的每一项代表每步的内容 -:::demo - -```vue - - - - -``` - -::: +> demo: tour step exhibition ## API @@ -298,15 +56,15 @@ page { | offset | 镂空遮罩相对于目标元素的偏移量 | [number, number] | `[8, 10]` | | current | 类型为 `step` 时,默认展示第几步 | number | `0` | | custom-class | 自定义 class 值 | string | '' | -| location | 弹出层位置,同 Popopver 的[location 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | `'bottom'` | -| next-step-Txt | 下一步按钮文案 | string | `'下一步'` | -| prev-step-Txt | 上一步按钮文案 | string | `'上一步'` | +| location | 弹出层位置,同 Popopver 的[location 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | `bottom` | +| next-step-Txt | 下一步按钮文案 | string | `下一步` | +| prev-step-Txt | 上一步按钮文案 | string | `上一步` | | complete-txt | 完成按钮文案 | string | `'完成'` | | mask | 是否显示镂空遮罩 | boolean | `true` | -| bg-color | 自定义背景色 | boolean | '' | +| bg-color | 自定义背景色 | boolean | - | | theme | 气泡遮罩层主题,同 Popopver 的[theme 属性](https://nutui.jd.com/#/zh-CN/component/popover) | string | `'light'` | -| mask-width | 镂空遮罩层宽度 | number \|string | '' | -| mask-height | 镂空遮罩层高度 | number \|string | '' | +| mask-width | 镂空遮罩层宽度 | number \| string | '' | +| mask-height | 镂空遮罩层高度 | number \| string | '' | | close-on-click-overlay | 是否在点击镂空遮罩层后关闭,同 Popopver 的[closeOnClickOverlay 属性](https://nutui.jd.com/#/zh-CN/component/popover) | Boolean | `true` | | show-prev-step | 是否展示上一步按钮 | boolean | `true` | | show-title-bar | 是否展示标题栏 | boolean | `false` |