From f6d2ec50c2340bb8a9cb30f24f9a7d43ce5595ff Mon Sep 17 00:00:00 2001 From: Kagol Date: Sun, 12 Nov 2023 22:59:09 -0800 Subject: [PATCH] docs(guide): [guide] optimize guide docs (#799) * docs(guide): optimize guide api docs * docs(guide): optimize guide demo docs --- ...vue => arrow-position-composition-api.vue} | 60 ++- ...osition.spec.ts => arrow-position.spec.ts} | 2 +- ...{arror-position.vue => arrow-position.vue} | 46 +- ...pi.vue => basic-usage-composition-api.vue} | 41 +- .../{base.spec.ts => basic-usage.spec.ts} | 2 +- .../app/guide/{base.vue => basic-usage.vue} | 39 +- .../pc/app/guide/callback-composition-api.vue | 25 +- .../sites/demos/pc/app/guide/callback.vue | 25 +- .../guide/content-step-composition-api.vue | 30 -- .../demos/pc/app/guide/content-step.spec.ts | 15 - .../sites/demos/pc/app/guide/content-step.vue | 40 -- ...poistion-alignmentAxis-composition-api.vue | 90 ---- .../guide-poistion-alignmentAxis.spec.ts | 22 - .../guide/guide-poistion-alignmentAxis.vue | 99 ----- ...ide-poistion-crossAxis-composition-api.vue | 91 ---- .../guide/guide-poistion-crossAxis.spec.ts | 22 - .../pc/app/guide/guide-poistion-crossAxis.vue | 100 ----- ...uide-poistion-mainAxis-composition-api.vue | 77 ---- .../pc/app/guide/guide-poistion-mainAxis.vue | 85 ---- ....vue => highlight-box-composition-api.vue} | 63 +-- ...om-hight.spec.ts => highlight-box.spec.ts} | 2 +- .../{dom-hight.vue => highlight-box.vue} | 61 ++- .../app/guide/image-text-composition-api.vue | 4 +- .../sites/demos/pc/app/guide/image-text.vue | 4 +- ...modal-overlay-opening-composition-api.vue} | 0 ....spec.ts => modal-overlay-opening.spec.ts} | 2 +- ...-opening.vue => modal-overlay-opening.vue} | 0 .../pc/app/guide/offset-composition-api.vue | 91 ++++ ...istion-mainAxis.spec.ts => offset.spec.ts} | 4 +- examples/sites/demos/pc/app/guide/offset.vue | 99 +++++ ...i.vue => only-content-composition-api.vue} | 11 +- ...ent-steps.spec.ts => only-content.spec.ts} | 4 +- .../{content-steps.vue => only-content.vue} | 14 +- .../pc/app/guide/size-composition-api.vue | 6 +- examples/sites/demos/pc/app/guide/size.vue | 6 +- .../app/guide/title-steps-composition-api.vue | 81 ---- .../demos/pc/app/guide/title-steps.spec.ts | 23 - .../sites/demos/pc/app/guide/title-steps.vue | 91 ---- .../demos/pc/app/guide/webdoc/guide.en.md | 7 + .../sites/demos/pc/app/guide/webdoc/guide.js | 415 ++++++++---------- 40 files changed, 573 insertions(+), 1326 deletions(-) rename examples/sites/demos/pc/app/guide/{arror-position-composition-api.vue => arrow-position-composition-api.vue} (70%) rename examples/sites/demos/pc/app/guide/{arror-position.spec.ts => arrow-position.spec.ts} (94%) rename examples/sites/demos/pc/app/guide/{arror-position.vue => arrow-position.vue} (72%) rename examples/sites/demos/pc/app/guide/{base-composition-api.vue => basic-usage-composition-api.vue} (50%) rename examples/sites/demos/pc/app/guide/{base.spec.ts => basic-usage.spec.ts} (96%) rename examples/sites/demos/pc/app/guide/{base.vue => basic-usage.vue} (51%) delete mode 100644 examples/sites/demos/pc/app/guide/content-step-composition-api.vue delete mode 100644 examples/sites/demos/pc/app/guide/content-step.spec.ts delete mode 100644 examples/sites/demos/pc/app/guide/content-step.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-alignmentAxis-composition-api.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-alignmentAxis.spec.ts delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-alignmentAxis.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-crossAxis-composition-api.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-crossAxis.spec.ts delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-crossAxis.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-mainAxis-composition-api.vue delete mode 100644 examples/sites/demos/pc/app/guide/guide-poistion-mainAxis.vue rename examples/sites/demos/pc/app/guide/{dom-hight-composition-api.vue => highlight-box-composition-api.vue} (53%) rename examples/sites/demos/pc/app/guide/{dom-hight.spec.ts => highlight-box.spec.ts} (95%) rename examples/sites/demos/pc/app/guide/{dom-hight.vue => highlight-box.vue} (56%) rename examples/sites/demos/pc/app/guide/{set-modal-overlay-opening-composition-api.vue => modal-overlay-opening-composition-api.vue} (100%) rename examples/sites/demos/pc/app/guide/{set-modal-overlay-opening.spec.ts => modal-overlay-opening.spec.ts} (89%) rename examples/sites/demos/pc/app/guide/{set-modal-overlay-opening.vue => modal-overlay-opening.vue} (100%) create mode 100644 examples/sites/demos/pc/app/guide/offset-composition-api.vue rename examples/sites/demos/pc/app/guide/{guide-poistion-mainAxis.spec.ts => offset.spec.ts} (85%) create mode 100644 examples/sites/demos/pc/app/guide/offset.vue rename examples/sites/demos/pc/app/guide/{content-steps-composition-api.vue => only-content-composition-api.vue} (70%) rename examples/sites/demos/pc/app/guide/{content-steps.spec.ts => only-content.spec.ts} (93%) rename examples/sites/demos/pc/app/guide/{content-steps.vue => only-content.vue} (74%) delete mode 100644 examples/sites/demos/pc/app/guide/title-steps-composition-api.vue delete mode 100644 examples/sites/demos/pc/app/guide/title-steps.spec.ts delete mode 100644 examples/sites/demos/pc/app/guide/title-steps.vue create mode 100644 examples/sites/demos/pc/app/guide/webdoc/guide.en.md diff --git a/examples/sites/demos/pc/app/guide/arror-position-composition-api.vue b/examples/sites/demos/pc/app/guide/arrow-position-composition-api.vue similarity index 70% rename from examples/sites/demos/pc/app/guide/arror-position-composition-api.vue rename to examples/sites/demos/pc/app/guide/arrow-position-composition-api.vue index df64d3fcc..d2510d440 100644 --- a/examples/sites/demos/pc/app/guide/arror-position-composition-api.vue +++ b/examples/sites/demos/pc/app/guide/arrow-position-composition-api.vue @@ -1,25 +1,23 @@ @@ -35,11 +33,11 @@ const data1 = ref([ { title: '新手引导标题1', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -48,11 +46,11 @@ const data2 = ref([ { title: '新手引导标题2', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -61,11 +59,11 @@ const data3 = ref([ { title: '新手引导标题3', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -75,11 +73,11 @@ const data4 = ref([ popPosition: 'top', title: '新手引导标题4', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -103,13 +101,7 @@ function stepStart4() { diff --git a/examples/sites/demos/pc/app/guide/arror-position.spec.ts b/examples/sites/demos/pc/app/guide/arrow-position.spec.ts similarity index 94% rename from examples/sites/demos/pc/app/guide/arror-position.spec.ts rename to examples/sites/demos/pc/app/guide/arrow-position.spec.ts index 1267db61c..076b139de 100644 --- a/examples/sites/demos/pc/app/guide/arror-position.spec.ts +++ b/examples/sites/demos/pc/app/guide/arrow-position.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' test('引导框箭头距离', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('guide#arror-position') + await page.goto('guide#arrow-position') const guide = page.locator('body > .tiny-guide') const arrow = guide.locator('.shepherd-arrow') diff --git a/examples/sites/demos/pc/app/guide/arror-position.vue b/examples/sites/demos/pc/app/guide/arrow-position.vue similarity index 72% rename from examples/sites/demos/pc/app/guide/arror-position.vue rename to examples/sites/demos/pc/app/guide/arrow-position.vue index 843270e80..80a78b341 100644 --- a/examples/sites/demos/pc/app/guide/arror-position.vue +++ b/examples/sites/demos/pc/app/guide/arrow-position.vue @@ -1,17 +1,23 @@ @@ -34,11 +40,11 @@ export default { { title: '新手引导标题1', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -47,11 +53,11 @@ export default { { title: '新手引导标题2', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -60,11 +66,11 @@ export default { { title: '新手引导标题3', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -74,11 +80,11 @@ export default { popPosition: 'top', title: '新手引导标题4', text: '这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案这里是新手引导文案', - domElement: '.pos', + domElement: '.demo-guide-arrow-position', button: [ { - text: '下一步', - action: 'next' + text: '完成', + action: 'complete' } ] } @@ -103,9 +109,7 @@ export default { diff --git a/examples/sites/demos/pc/app/guide/base-composition-api.vue b/examples/sites/demos/pc/app/guide/basic-usage-composition-api.vue similarity index 50% rename from examples/sites/demos/pc/app/guide/base-composition-api.vue rename to examples/sites/demos/pc/app/guide/basic-usage-composition-api.vue index 624e3539a..833027978 100644 --- a/examples/sites/demos/pc/app/guide/base-composition-api.vue +++ b/examples/sites/demos/pc/app/guide/basic-usage-composition-api.vue @@ -1,17 +1,18 @@ - - diff --git a/examples/sites/demos/pc/app/guide/base.spec.ts b/examples/sites/demos/pc/app/guide/basic-usage.spec.ts similarity index 96% rename from examples/sites/demos/pc/app/guide/base.spec.ts rename to examples/sites/demos/pc/app/guide/basic-usage.spec.ts index 8a30a68d3..cbaf0bebe 100644 --- a/examples/sites/demos/pc/app/guide/base.spec.ts +++ b/examples/sites/demos/pc/app/guide/basic-usage.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' test('基础用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('guide#base') + await page.goto('guide#basic-usage') const activeDom = await page.getByRole('button', { name: '基础新手引导开始' }) const step1 = page.getByRole('heading', { name: '新手引导标题1' }) diff --git a/examples/sites/demos/pc/app/guide/base.vue b/examples/sites/demos/pc/app/guide/basic-usage.vue similarity index 51% rename from examples/sites/demos/pc/app/guide/base.vue rename to examples/sites/demos/pc/app/guide/basic-usage.vue index 8586007a6..b8669d3de 100644 --- a/examples/sites/demos/pc/app/guide/base.vue +++ b/examples/sites/demos/pc/app/guide/basic-usage.vue @@ -1,21 +1,23 @@ - - diff --git a/examples/sites/demos/pc/app/guide/callback-composition-api.vue b/examples/sites/demos/pc/app/guide/callback-composition-api.vue index 25f9d1f7b..e5389638a 100644 --- a/examples/sites/demos/pc/app/guide/callback-composition-api.vue +++ b/examples/sites/demos/pc/app/guide/callback-composition-api.vue @@ -1,12 +1,13 @@