From aef96eda64f7db52a8270c325d9bba9a60be6e74 Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Thu, 14 Dec 2023 15:40:01 +0800 Subject: [PATCH] docs(sites): [pager, form] optimize docs and demos (#1135) --- .../pc/app/form/events-composition-api.vue | 46 ++++++++++++++++ .../sites/demos/pc/app/form/events.spec.ts | 12 +++++ examples/sites/demos/pc/app/form/events.vue | 52 +++++++++++++++++++ .../form-validate-field-composition-api.vue | 27 +++++----- .../pc/app/form/form-validate-field.spec.ts | 11 +++- .../demos/pc/app/form/form-validate-field.vue | 21 ++++---- .../form/form-validation-composition-api.vue | 7 ++- .../demos/pc/app/form/form-validation.vue | 6 ++- .../form/label-position-composition-api.vue | 2 +- .../demos/pc/app/form/label-position.vue | 2 +- .../sites/demos/pc/app/form/webdoc/form.js | 26 +++++++--- ...popper-append-to-body-composition-api.vue} | 0 ....spec.ts => popper-append-to-body.spec.ts} | 0 ...-to-body.vue => popper-append-to-body.vue} | 0 .../sites/demos/pc/app/pager/webdoc/pager.js | 4 +- 15 files changed, 174 insertions(+), 42 deletions(-) create mode 100644 examples/sites/demos/pc/app/form/events-composition-api.vue create mode 100644 examples/sites/demos/pc/app/form/events.spec.ts create mode 100644 examples/sites/demos/pc/app/form/events.vue rename examples/sites/demos/pc/app/pager/{page-append-to-body-composition-api.vue => popper-append-to-body-composition-api.vue} (100%) rename examples/sites/demos/pc/app/pager/{page-append-to-body.spec.ts => popper-append-to-body.spec.ts} (100%) rename examples/sites/demos/pc/app/pager/{page-append-to-body.vue => popper-append-to-body.vue} (100%) diff --git a/examples/sites/demos/pc/app/form/events-composition-api.vue b/examples/sites/demos/pc/app/form/events-composition-api.vue new file mode 100644 index 000000000..7ba308387 --- /dev/null +++ b/examples/sites/demos/pc/app/form/events-composition-api.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/examples/sites/demos/pc/app/form/events.spec.ts b/examples/sites/demos/pc/app/form/events.spec.ts new file mode 100644 index 000000000..d1bbcff21 --- /dev/null +++ b/examples/sites/demos/pc/app/form/events.spec.ts @@ -0,0 +1,12 @@ +import { test, expect } from '@playwright/test' + +test('表单事件', async ({ page }) => { + page.on('pageerror', (exception) => expect(exception).toBeNull()) + await page.goto('form#events') + + const demo = page.locator('#events') + const messageModal = page.locator('.tiny-modal.active') + + await demo.getByRole('button', { name: '提交' }).click() + await expect(messageModal).toHaveText('校验事件触发了') +}) diff --git a/examples/sites/demos/pc/app/form/events.vue b/examples/sites/demos/pc/app/form/events.vue new file mode 100644 index 000000000..85bb47213 --- /dev/null +++ b/examples/sites/demos/pc/app/form/events.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/examples/sites/demos/pc/app/form/form-validate-field-composition-api.vue b/examples/sites/demos/pc/app/form/form-validate-field-composition-api.vue index 90aa5433c..093afc214 100644 --- a/examples/sites/demos/pc/app/form/form-validate-field-composition-api.vue +++ b/examples/sites/demos/pc/app/form/form-validate-field-composition-api.vue @@ -1,25 +1,19 @@