diff --git a/examples/sites/demos/apis/anchor.js b/examples/sites/demos/apis/anchor.js index c1d39004ef..3cb61c7ff5 100644 --- a/examples/sites/demos/apis/anchor.js +++ b/examples/sites/demos/apis/anchor.js @@ -84,7 +84,7 @@ export default { }, { name: 'link-click', - type: '(event: Event, currentLink: {link: string, title: string}) => void', + type: '(event: Event, currentLink: { link: string, title: string } ) => void', defaultValue: '', desc: { 'zh-CN': '锚点点击事件', @@ -93,18 +93,6 @@ export default { mode: ['pc', 'mobile-first'], pcDemo: 'set-container', mfDemo: 'set-container' - }, - { - name: 'on-change', - type: '(hash: string) => void', - defaultValue: '', - desc: { - 'zh-CN': '使用 change 代替;[deprecated v3.12.0 废弃,v3.17.0 移除;移除原因:命名规范]', - 'en-US': - 'use change instead [deprecated v3.12.0 abandoned, v3.17.0 removed; reason for removal: naming convention]' - }, - mode: ['pc'], - pcDemo: 'change' } ], methods: [], diff --git a/examples/sites/demos/apis/modal.js b/examples/sites/demos/apis/modal.js index 894e52144a..02a5087725 100644 --- a/examples/sites/demos/apis/modal.js +++ b/examples/sites/demos/apis/modal.js @@ -27,7 +27,7 @@ export default { 'Customize the props of the cancel button. The optional values ​​are consistent with the Button component' }, mode: ['pc'], - pcDemo: 'footer-btn-props' + pcDemo: 'modal-footer' }, { name: 'cancel-content', @@ -38,7 +38,7 @@ export default { 'en-US': 'Customize cancel button content' }, mode: ['pc', 'mobile-first'], - pcDemo: 'footer-btn-content', + pcDemo: 'modal-footer', mfDemo: '' }, { @@ -52,7 +52,7 @@ export default { 'Customize the confirmation button props, the optional values are consistent with the Button component' }, mode: ['pc'], - pcDemo: 'footer-btn-props' + pcDemo: 'modal-footer' }, { name: 'confirm-content', @@ -63,7 +63,7 @@ export default { 'en-US': 'Customize confirmation button content' }, mode: ['pc', 'mobile-first'], - pcDemo: 'footer-btn-content', + pcDemo: 'modal-footer', mfDemo: '' }, { @@ -97,7 +97,7 @@ export default { 'en-US': "Delay for automatic shutdown, only valid when type is 'message'" }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'duration', + pcDemo: 'message-close', mobileDemo: 'duration', mfDemo: '' }, @@ -110,7 +110,7 @@ export default { 'en-US': 'Whether to allow pressing the Esc key to close a window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'esc-closable', + pcDemo: 'modal-other', mobileDemo: 'mask-closable', mfDemo: '' }, @@ -123,7 +123,7 @@ export default { 'en-US': 'Control bottom dragable' }, mode: ['pc'], - pcDemo: 'footer-slot' + pcDemo: 'modal-footer' }, { name: 'fullscreen', @@ -134,7 +134,7 @@ export default { 'en-US': 'Whether to maximize the display' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'fullscreen', + pcDemo: 'modal-size', mobileDemo: 'fullscreen', mfDemo: '' }, @@ -147,7 +147,7 @@ export default { 'en-US': 'window height' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'resize', + pcDemo: 'modal-size', mobileDemo: '', mfDemo: '' }, @@ -161,7 +161,7 @@ export default { "If you don't want the window to be clicked repeatedly, you can set a unique id to prevent repeated prompts. This is only valid when type is 'message'" }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'id', + pcDemo: 'message-id', mobileDemo: 'id', mfDemo: '' }, @@ -174,7 +174,7 @@ export default { 'en-US': 'Whether to reset the form data when closing the pop-up window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'is-form-reset', + pcDemo: 'modal-other', mobileDemo: 'is-form-reset', mfDemo: '' }, @@ -187,7 +187,7 @@ export default { 'en-US': 'Whether to lock the scroll bar and not allow the page to scroll' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'lock-scroll', + pcDemo: 'modal-lock', mobileDemo: 'lock-scroll', mfDemo: '' }, @@ -200,7 +200,7 @@ export default { 'en-US': 'Whether to lock the page and not allow any operations outside the window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'lock-view', + pcDemo: 'modal-lock', mobileDemo: 'lock-view', mfDemo: '' }, @@ -213,7 +213,7 @@ export default { 'en-US': 'Whether to display the mask layer' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'lock-view1', + pcDemo: 'modal-mask', mobileDemo: 'mask-closable', mfDemo: '' }, @@ -226,7 +226,7 @@ export default { 'en-US': 'Whether to allow clicking on the mask layer to close the window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'mask-closable', + pcDemo: 'modal-mask', mobileDemo: 'mask-closable', mfDemo: '' }, @@ -239,7 +239,7 @@ export default { 'en-US': 'Window contents' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'message', + pcDemo: 'basic-usage', mobileDemo: 'message', mfDemo: '' }, @@ -263,7 +263,7 @@ export default { 'en-US': 'Minimum height of window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'min-height', + pcDemo: 'modal-resize', mobileDemo: 'min-height', mfDemo: '' }, @@ -276,7 +276,7 @@ export default { 'en-US': 'The minimum width of the window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'min-width', + pcDemo: 'modal-resize', mobileDemo: 'min-width', mfDemo: '' }, @@ -289,7 +289,7 @@ export default { 'en-US': 'Whether to display' }, mode: ['pc', 'mobile'], - pcDemo: 'value', + pcDemo: 'basic-usage', mobileDemo: 'cancel-event' }, { @@ -323,7 +323,7 @@ export default { 'en-US': 'Whether to allow dragging to resize the window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'resize', + pcDemo: 'modal-resize', mobileDemo: 'resize', mfDemo: '' }, @@ -347,7 +347,8 @@ export default { 'en-US': 'Display bottom' }, mode: ['pc', 'mobile-first'], - pcDemo: 'showFooter', + pcDemo: 'modal-footer', + mobileDemo: 'showFooter', mfDemo: '' }, { @@ -359,21 +360,10 @@ export default { 'en-US': 'Display Header' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'showHeader', + pcDemo: 'modal-header', mobileDemo: 'showHeader', mfDemo: '' }, - { - name: 'showFooter', - type: 'Boolean', - defaultValue: 'true', - desc: { - 'zh-CN': '

是否显示底部

', - 'en-US': 'display different button' - }, - mode: ['mobile'], - mobileDemo: 'showFooter' - }, { name: 'status', typeAnchorName: 'IStatus', @@ -397,20 +387,20 @@ export default { 'en-US': 'Window title' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'title', + pcDemo: 'modal-header', mobileDemo: 'title', mfDemo: '' }, { name: 'top', type: 'number | string', - defaultValue: '15', + defaultValue: '80', desc: { 'zh-CN': "消息距离顶部的位置,仅当 type 为 'message' 时有效", 'en-US': "The position of the message from the top, only valid when type is 'message'" }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'top', + pcDemo: 'message-top', mobileDemo: 'top', mfDemo: '' }, @@ -423,7 +413,7 @@ export default { 'en-US': 'Window type' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'type', + pcDemo: 'basic-usage', mobileDemo: 'type', mfDemo: '' }, @@ -448,7 +438,7 @@ export default { 'The width of the window(Set the width in pixels or percentages, and the browser window size can be changed to display in the center)' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'resize', + pcDemo: 'modal-size', mobileDemo: 'grid', mfDemo: '' }, @@ -460,19 +450,8 @@ export default { 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)', 'en-US': 'Customize the stacking order (may be used in some special scenarios, such as when it is blocked)' }, - mode: ['pc', 'mobile-first'], - pcDemo: 'z-index', - mfDemo: '' - }, - { - name: 'zIndex', - type: 'Number', - defaultValue: '3000', - desc: { - 'zh-CN': '

自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)

', - 'en-US': 'display different button' - }, - mode: ['mobile', 'mobile-first'], + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'modal-other', mobileDemo: 'zIndex', mfDemo: '' } @@ -488,7 +467,7 @@ export default { 'en-US': 'This event is triggered when the Cancel button is clicked' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'cancel-event', mfDemo: '' }, @@ -502,7 +481,7 @@ export default { 'en-US': 'This event is triggered when the close button is clicked' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'close-event', mfDemo: '' }, @@ -516,7 +495,7 @@ export default { 'en-US': 'This event is triggered when the OK button is clicked' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'confirm-event', mfDemo: '' }, @@ -530,7 +509,7 @@ export default { 'en-US': 'This event is triggered when the window is closed' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'hide-event', mfDemo: '' }, @@ -544,7 +523,7 @@ export default { 'en-US': 'This event is triggered when the window is displayed' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'show-event', mfDemo: '' }, @@ -558,7 +537,7 @@ export default { 'en-US': 'This event is triggered when a window is zoomed in or out' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'event', + pcDemo: 'modal-event', mobileDemo: 'zoom-event', mfDemo: '' } @@ -574,7 +553,7 @@ export default { 'en-US': 'Default slot' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'default-grid', + pcDemo: 'modal-fn-slots', mobileDemo: 'cancel-event', mfDemo: '' }, @@ -587,7 +566,7 @@ export default { 'en-US': 'Template at the bottom of the window' }, mode: ['pc', 'mobile', 'mobile-first'], - pcDemo: 'footer-slot', + pcDemo: 'modal-fn-slots', mobileDemo: 'footer-slot', mfDemo: '' } diff --git a/examples/sites/demos/apis/notify.js b/examples/sites/demos/apis/notify.js index a57f08830a..5c0b3e60d6 100644 --- a/examples/sites/demos/apis/notify.js +++ b/examples/sites/demos/apis/notify.js @@ -41,10 +41,12 @@ export default { { name: 'duration', type: 'number', - defaultValue: '4500', + defaultValue: '', desc: { - 'zh-CN': '自动关闭延时毫秒数', - 'en-US': 'Automatic shutdown delay in milliseconds' + 'zh-CN': + '通知自动关闭时间,单位毫秒数。 默认情况, success info 延时5秒 warning error 延时10秒自动关闭 ', + 'en-US': + 'Automatic notification shutdown time, in milliseconds. By default, success info Delay is 5 seconds. warning error Delay is 10 seconds' }, mode: ['pc'], pcDemo: 'duration' @@ -59,11 +61,11 @@ export default { 'en-US': 'Notification message text, which can be customized using JSX.' }, mode: ['pc'], - pcDemo: 'message' + pcDemo: 'basic-usage' }, { name: 'position', - type: "'top-right' | 'bottom-right'", + type: "'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'", defaultValue: "'bottom-right'", desc: { 'zh-CN': '通知显示位置', @@ -115,7 +117,7 @@ export default { 'en-US': 'Notification message title, which can be customized by JSX.' }, mode: ['pc'], - pcDemo: 'title' + pcDemo: 'basic-usage' }, { name: 'type', diff --git a/examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue b/examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue index a32330c3b5..bed0c8d854 100644 --- a/examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue +++ b/examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue @@ -78,14 +78,15 @@ function loadAll() { diff --git a/examples/sites/demos/pc/app/autocomplete/slot.vue b/examples/sites/demos/pc/app/autocomplete/slot.vue index 6390f8f518..c978c7a0fa 100644 --- a/examples/sites/demos/pc/app/autocomplete/slot.vue +++ b/examples/sites/demos/pc/app/autocomplete/slot.vue @@ -85,14 +85,15 @@ export default { diff --git a/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue index 3baf8be69f..e705127be3 100644 --- a/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue +++ b/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue @@ -2,7 +2,7 @@

基本按钮

- 主要按钮 + 主要按钮 次要按钮 成功按钮 信息按钮 diff --git a/examples/sites/demos/pc/app/button/basic-usage.vue b/examples/sites/demos/pc/app/button/basic-usage.vue index 81bce35b16..081059fd34 100644 --- a/examples/sites/demos/pc/app/button/basic-usage.vue +++ b/examples/sites/demos/pc/app/button/basic-usage.vue @@ -2,7 +2,7 @@

基本按钮

- 主要按钮 + 主要按钮 次要按钮 成功按钮 信息按钮 diff --git a/examples/sites/demos/pc/app/button/ghost-composition-api.vue b/examples/sites/demos/pc/app/button/ghost-composition-api.vue index d3bfae3f7a..e6c708940f 100644 --- a/examples/sites/demos/pc/app/button/ghost-composition-api.vue +++ b/examples/sites/demos/pc/app/button/ghost-composition-api.vue @@ -1,11 +1,11 @@ diff --git a/examples/sites/demos/pc/app/button/ghost.spec.ts b/examples/sites/demos/pc/app/button/ghost.spec.ts index b337116abc..3961615447 100644 --- a/examples/sites/demos/pc/app/button/ghost.spec.ts +++ b/examples/sites/demos/pc/app/button/ghost.spec.ts @@ -11,66 +11,29 @@ test('幽灵按钮', async ({ page }) => { await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(25, 25, 25)') await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(89, 89, 89)') - await page.waitForTimeout(100) - await getGhostBtn(0).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(25, 25, 25)') - await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)') // 次要幽灵按钮 - await page.waitForTimeout(1000) - await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(25, 25, 25)') - await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(194, 194, 194)') - await page.waitForTimeout(100) - await getGhostBtn(1).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(25, 25, 25)') + await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(89, 89, 89)') await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)') + await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(128, 128, 128)') // 成功幽灵按钮 await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(92, 179, 0)') await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(218, 242, 187)') - await page.waitForTimeout(100) - await getGhostBtn(2).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(92, 179, 0)') - await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(92, 179, 0)') // 信息幽灵按钮 await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(20, 118, 255)') await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(222, 236, 255)') - await page.waitForTimeout(100) - await getGhostBtn(3).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(20, 118, 255)') - await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(20, 118, 255)') // 告警幽灵按钮 await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(255, 136, 0)') await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(255, 235, 209)') - await page.waitForTimeout(100) - await getGhostBtn(4).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(255, 136, 0)') - await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(255, 136, 0)') // 危险幽灵按钮 await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(242, 48, 48)') await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(252, 226, 224)') - await page.waitForTimeout(100) - await getGhostBtn(5).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(242, 48, 48)') - await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(242, 48, 48)') }) diff --git a/examples/sites/demos/pc/app/button/ghost.vue b/examples/sites/demos/pc/app/button/ghost.vue index dbf529801d..ad303e10fd 100644 --- a/examples/sites/demos/pc/app/button/ghost.vue +++ b/examples/sites/demos/pc/app/button/ghost.vue @@ -1,11 +1,11 @@ diff --git a/examples/sites/demos/pc/app/calendar-view/calendar-disabled-day.spec.ts b/examples/sites/demos/pc/app/calendar-view/calendar-disabled-day.spec.ts index 257278460e..6e9eb4eb06 100644 --- a/examples/sites/demos/pc/app/calendar-view/calendar-disabled-day.spec.ts +++ b/examples/sites/demos/pc/app/calendar-view/calendar-disabled-day.spec.ts @@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test' test('日期禁用', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('calendar-view#calendar-disabled-day') - const day10 = page.getByText('10').nth(2) + const day10 = page.getByText('10').nth(3) const day14 = page.getByText('14').nth(1) const day15 = page.getByText('15').nth(1) await expect(day10).toHaveClass(/is-disabled/) diff --git a/examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.spec.ts b/examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.spec.ts index 821dbfc55c..86b7d1fa11 100644 --- a/examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.spec.ts +++ b/examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.spec.ts @@ -10,8 +10,8 @@ test('动态加载且父子级不相关联 lazyload & checkStrictly', async ({ p const loadingSvg = page.getByRole('menuitem', { name: '选项1' }).locator('svg') await expect(loadingSvg).toHaveClass(/tiny-cascader-node__postfix/) await page.waitForTimeout(100) - await page.getByRole('menuitem', { name: '选项2' }).getByRole('radio').click() + await page.getByRole('menuitem', { name: '选项2' }).getByRole('radio').nth(0).click() await page.getByRole('textbox', { name: '请选择' }).click() - const light = page.getByRole('menuitem', { name: '选项2' }).getByRole('radio') + const light = page.getByRole('menuitem', { name: '选项2' }).getByRole('radio').nth(0) await expect(light).toHaveClass('tiny-radio is-checked') }) diff --git a/examples/sites/demos/pc/app/cascader/check-strictly.spec.ts b/examples/sites/demos/pc/app/cascader/check-strictly.spec.ts index 121cdf8bcf..ea902d4a9c 100644 --- a/examples/sites/demos/pc/app/cascader/check-strictly.spec.ts +++ b/examples/sites/demos/pc/app/cascader/check-strictly.spec.ts @@ -4,8 +4,8 @@ test('父子级不相关联', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('cascader#check-strictly') await page.getByRole('textbox', { name: '请选择' }).click() - await page.getByRole('menuitem', { name: '开发' }).getByRole('radio').click() + await page.getByRole('menuitem', { name: '开发' }).getByRole('radio').nth(0).click() await page.getByRole('textbox', { name: '请选择' }).click() - const light = page.getByRole('menuitem', { name: '开发' }).getByRole('radio') + const light = page.getByRole('menuitem', { name: '开发' }).getByRole('radio').nth(0) await expect(light).toHaveClass('tiny-radio is-checked') }) diff --git a/examples/sites/demos/pc/app/chart/question/demo4-composition-api.vue b/examples/sites/demos/pc/app/chart/question/demo4-composition-api.vue index c545354263..019fcb8d8b 100644 --- a/examples/sites/demos/pc/app/chart/question/demo4-composition-api.vue +++ b/examples/sites/demos/pc/app/chart/question/demo4-composition-api.vue @@ -38,9 +38,10 @@ const options = ref({ }) function addData() { - chartData.value.rows.push({ - 日期: `1月${chartData.value.rows.length + 1}日`, - value: Math.ceil(10000 * Math.random()) + options.value.data.push({ + 'Day': `1月${options.value.data.length + 1}日`, + 'Domestics': Math.ceil(50 * Math.random()), + 'Abroad': Math.ceil(50 * Math.random()) }) } diff --git a/examples/sites/demos/pc/app/chart/question/demo4.vue b/examples/sites/demos/pc/app/chart/question/demo4.vue index a7a7190aff..c1b4a66512 100644 --- a/examples/sites/demos/pc/app/chart/question/demo4.vue +++ b/examples/sites/demos/pc/app/chart/question/demo4.vue @@ -45,9 +45,10 @@ export default { }, methods: { addData() { - this.chartData.rows.push({ - 日期: `1月${this.chartData.rows.length + 1}日`, - value: Math.ceil(10000 * Math.random()) + this.options.data.push({ + 'Day': `1月${this.options.data.length + 1}日`, + 'Domestics': Math.ceil(50 * Math.random()), + 'Abroad': Math.ceil(50 * Math.random()) }) } } diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js b/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js index 63e82a14b7..e26364aaaf 100644 --- a/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js +++ b/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js @@ -7,7 +7,7 @@ export default { 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' }, 'desc': { 'zh-CN': - '

可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE 9/10/11,Chrome,Firefox,Safari 等)底层依赖轻量级的 Canvas 类库 ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。 高德地图需要外网访问权限才能正常使用\n

\n', + '

可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE 9/10/11,Chrome,Firefox,Safari 等)底层依赖轻量级的 Canvas 类库 ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。 \n

\n', 'en-US': '

can run smoothly on PCs and mobile devices and is compatible with most browsers. (Internet Explorer 9/10/11, Chrome, Firefox, Safari, etc.) The bottom layer relies on the lightweight Canvas class library ZRender to provide intuitive, vivid, interactive, and highly personalized data visualization charts. AutoNavi Map requires the access permission from the external network. \n

\n' }, diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart.js b/examples/sites/demos/pc/app/chart/webdoc/chart.js index e3c07f92ba..f0c7766bb3 100644 --- a/examples/sites/demos/pc/app/chart/webdoc/chart.js +++ b/examples/sites/demos/pc/app/chart/webdoc/chart.js @@ -10,7 +10,7 @@ export default { }, desc: { 'zh-CN': - '

图表组件支持 双向数据绑定,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE 9/10/11,Chrome,Firefox,Safari 等)底层依赖轻量级的 Canvas 类库 ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。\n可通过 theme 自定义主题\n百度地图和高德地图需要外网访问权限才能正常使用\n

\n', + '

图表组件支持 双向数据绑定,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE 9/10/11,Chrome,Firefox,Safari 等)底层依赖轻量级的 Canvas 类库 ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。\n可通过 theme 自定义主题\n

\n', 'en-US': '

The chart component supports bidirectional data binding, which can run smoothly on PCs and mobile devices and is compatible with most browsers. (Internet Explorer 9/10/11, Chrome, Firefox, Safari, etc.) The bottom layer relies on the lightweight Canvas class library ZRender to provide intuitive, vivid, interactive, and highly personalized data visualization charts. \nYou can use theme to customize themes. \nBaidu Maps and AutoNavi Maps require external network access. \n

\n' }, diff --git a/examples/sites/demos/pc/app/file-upload/disabled-composition-api.vue b/examples/sites/demos/pc/app/file-upload/disabled-composition-api.vue index 5d7840b22b..e9a6314805 100644 --- a/examples/sites/demos/pc/app/file-upload/disabled-composition-api.vue +++ b/examples/sites/demos/pc/app/file-upload/disabled-composition-api.vue @@ -1,7 +1,7 @@ diff --git a/examples/sites/demos/pc/app/file-upload/disabled.vue b/examples/sites/demos/pc/app/file-upload/disabled.vue index b5b7e21989..9ce5ef6b81 100644 --- a/examples/sites/demos/pc/app/file-upload/disabled.vue +++ b/examples/sites/demos/pc/app/file-upload/disabled.vue @@ -1,7 +1,7 @@ diff --git a/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts b/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts index 83ebbc74bf..6fea8ad6ce 100644 --- a/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts +++ b/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts @@ -15,7 +15,8 @@ test('文件列表', async ({ page }) => { const currentPath = path.resolve(__dirname, '测试.jpg') await expect(width).toBeGreaterThanOrEqual(height) - await expect(height).toBeGreaterThanOrEqual(22, 0) + // 行高取1.5,计算结果是21 + await expect(height).toBeGreaterThanOrEqual(21, 0) await expect(items).toHaveCount(2) await expect(items).toHaveText([/test1/, /test2/]) await fileChooser.setFiles(currentPath) diff --git a/examples/sites/demos/pc/app/filter-panel/basic-usage.spec.ts b/examples/sites/demos/pc/app/filter-panel/basic-usage.spec.ts index 83ce31cdb5..3ee7392190 100644 --- a/examples/sites/demos/pc/app/filter-panel/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/filter-panel/basic-usage.spec.ts @@ -13,7 +13,7 @@ test('基本用法', async ({ page }) => { await button.click() await popPanel.isVisible() - await page.getByRole('radio', { name: '等于' }).click() + await page.locator('label').filter({ hasText: '等于' }).click() await button.getByText('物品数量等于').isVisible() await inputEl.click() await inputEl.fill('10') diff --git a/examples/sites/demos/pc/app/filter-panel/event.spec.ts b/examples/sites/demos/pc/app/filter-panel/event.spec.ts index 1803e90c61..45f248f584 100644 --- a/examples/sites/demos/pc/app/filter-panel/event.spec.ts +++ b/examples/sites/demos/pc/app/filter-panel/event.spec.ts @@ -13,7 +13,7 @@ test('事件', async ({ page }) => { // handle-clear事件 await button.click() await popPanel.isVisible() - await page.getByRole('radio', { name: '等于' }).click() + await page.locator('label').filter({ hasText: '等于' }).click() await expect(button).toHaveText('物品数量等于') await clear.click() await expect(button).toHaveText('物品数量') diff --git a/examples/sites/demos/pc/app/floatbar/custom-style-composition-api.vue b/examples/sites/demos/pc/app/floatbar/custom-style-composition-api.vue index 3be2e21ae9..c3b4ca3a8a 100644 --- a/examples/sites/demos/pc/app/floatbar/custom-style-composition-api.vue +++ b/examples/sites/demos/pc/app/floatbar/custom-style-composition-api.vue @@ -1,10 +1,10 @@ @@ -16,10 +16,10 @@ import { Floatbar as TinyFloatbar } from '@opentiny/vue' diff --git a/examples/sites/demos/pc/app/floatbar/custom-style.spec.ts b/examples/sites/demos/pc/app/floatbar/custom-style.spec.ts index 4c0da1f251..e4232727c6 100644 --- a/examples/sites/demos/pc/app/floatbar/custom-style.spec.ts +++ b/examples/sites/demos/pc/app/floatbar/custom-style.spec.ts @@ -5,10 +5,10 @@ test('自定义样式', async ({ page }) => { await page.goto('floatbar#custom-style') const floatbar = page.locator('.tiny-float-bar') - const item = page.getByRole('listitem').filter({ hasText: 'Default-A' }) + const item = page.getByRole('listitem').filter({ hasText: '本地引入' }) await expect(floatbar).toHaveClass(/custom/) - await expect(floatbar).toHaveCSS('background-color', 'rgb(222, 184, 135)') + await expect(floatbar).toHaveCSS('background-color', 'rgb(219, 219, 219)') await item.hover() - await expect(item).toHaveCSS('background-color', 'rgba(24, 144, 255, 0.06)') - await expect(item.locator('a')).toHaveCSS('color', 'rgb(255, 255, 255)') + await expect(item).toHaveCSS('background-color', 'rgb(255, 255, 255)') + await expect(item.locator('a')).toHaveCSS('color', 'rgb(25, 25, 25)') }) diff --git a/examples/sites/demos/pc/app/floatbar/custom-style.vue b/examples/sites/demos/pc/app/floatbar/custom-style.vue index 1eea0e1938..44a2e492bf 100644 --- a/examples/sites/demos/pc/app/floatbar/custom-style.vue +++ b/examples/sites/demos/pc/app/floatbar/custom-style.vue @@ -1,10 +1,10 @@ @@ -22,10 +22,10 @@ export default { diff --git a/examples/sites/demos/pc/app/grid/import-export/import-excel-composition-api.vue b/examples/sites/demos/pc/app/grid/import-export/import-excel-composition-api.vue index 0d5fa22060..6302ba71ce 100644 --- a/examples/sites/demos/pc/app/grid/import-export/import-excel-composition-api.vue +++ b/examples/sites/demos/pc/app/grid/import-export/import-excel-composition-api.vue @@ -1,6 +1,6 @@ diff --git a/examples/sites/demos/pc/app/grid/import-export/import-excel.vue b/examples/sites/demos/pc/app/grid/import-export/import-excel.vue index f3d24ae138..b849c69714 100644 --- a/examples/sites/demos/pc/app/grid/import-export/import-excel.vue +++ b/examples/sites/demos/pc/app/grid/import-export/import-excel.vue @@ -1,6 +1,6 @@ diff --git a/examples/sites/demos/pc/app/grid/webdoc/grid-import-export.js b/examples/sites/demos/pc/app/grid/webdoc/grid-import-export.js index fefd229979..3bc3efb57a 100644 --- a/examples/sites/demos/pc/app/grid/webdoc/grid-import-export.js +++ b/examples/sites/demos/pc/app/grid/webdoc/grid-import-export.js @@ -20,6 +20,7 @@ export default {

本示例使用的xlsx版本为0.18.2,导入的excel表格,表头字段需与表格field字段保持一致。

提示: xlsx 是一个非常强大的前端 EXCEL 文件操作库,支持表格带格式导入导出,可兼容 IE9+ 版本的浏览器。

详情参考:https://github.com/SheetJS/sheetjs

+

注意:如需体验demo,需要将demo中注释部分代码取消注释,切自行安装相关依赖。

`, 'en-US': 'For details, see the following example.' diff --git a/examples/sites/demos/pc/app/icon/show-title-composition-api.vue b/examples/sites/demos/pc/app/icon/show-title-composition-api.vue deleted file mode 100644 index d598871bfd..0000000000 --- a/examples/sites/demos/pc/app/icon/show-title-composition-api.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/icon/show-title.spec.ts b/examples/sites/demos/pc/app/icon/show-title.spec.ts deleted file mode 100644 index 119356d615..0000000000 --- a/examples/sites/demos/pc/app/icon/show-title.spec.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('显示title', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('icon#show-title') - - await expect(page.getByTitle('复制')).toHaveCount(1) -}) diff --git a/examples/sites/demos/pc/app/icon/show-title.vue b/examples/sites/demos/pc/app/icon/show-title.vue deleted file mode 100644 index 881008f659..0000000000 --- a/examples/sites/demos/pc/app/icon/show-title.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/icon/webdoc/icon.js b/examples/sites/demos/pc/app/icon/webdoc/icon.js index 9307ac517e..450314c3e1 100644 --- a/examples/sites/demos/pc/app/icon/webdoc/icon.js +++ b/examples/sites/demos/pc/app/icon/webdoc/icon.js @@ -15,19 +15,6 @@ export default { }, codeFiles: ['basic-usage.vue'] }, - { - demoId: 'show-title', - name: { - 'zh-CN': '显示 Title', - 'en-US': 'Display Title' - }, - desc: { - 'zh-CN': '通过其父元素的 title 属性,实现给图标增加 Title 的功能。', - 'en-US': - 'By using the title attribute of its parent element, the function of adding Title to the icon is implemented.' - }, - codeFiles: ['show-title.vue'] - }, { demoId: 'list', name: { diff --git a/examples/sites/demos/pc/app/modal/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/modal/basic-usage-composition-api.vue index c7f1913336..4bdea8fa33 100644 --- a/examples/sites/demos/pc/app/modal/basic-usage-composition-api.vue +++ b/examples/sites/demos/pc/app/modal/basic-usage-composition-api.vue @@ -1,15 +1,35 @@ + + diff --git a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts b/examples/sites/demos/pc/app/modal/basic-usage.spec.ts deleted file mode 100644 index c3df351aa5..0000000000 --- a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('基本用法', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#basic-usage') - - const modal = page.locator('.tiny-modal.type__alert').nth(1) - const confirm = page.locator('.tiny-modal.type__confirm') - const notify = page.locator('.tiny-notify__message-zone > .tiny-notify__content-wrapper > .tiny-notify__content') - - // 基本提示框 - await page.getByRole('button', { name: /基本提示框/ }).click() - await expect(modal).toBeVisible() - await expect(modal).toHaveClass(/is__mask/) - await page.getByRole('button', { name: /确定/, exact: true }).click() - await expect(modal).not.toBeVisible() - await page.getByRole('button', { name: /基本提示框/ }).click() - await page.locator('.tiny-modal__close-btn').click() - await expect(modal).not.toBeVisible() - - // 成功提示框 - await page.getByRole('button', { name: /成功提示框/ }).click() - await expect(modal).toHaveClass(/status__success/) - await expect(modal.locator('.tiny-modal__header svg').first()).toHaveClass(/tiny-modal-svg__success/) - await page.getByRole('button', { name: /确定/, exact: true }).click() - await expect(page.locator('.tiny-modal.type__alert.status__success')).not.toBeVisible() - - // 失败提示框 - await page.getByRole('button', { name: /失败提示框/ }).click() - await expect(modal).toHaveClass(/status__error/) - await expect(modal.locator('.tiny-modal__header svg').first()).toHaveClass(/tiny-svg tiny-modal-svg__error/) - await page.getByRole('button', { name: /确定/, exact: true }).click() - await expect(page.locator('.tiny-modal.type__alert.status__error')).not.toBeVisible() - - // 确认提示框 - await page.getByRole('button', { name: /确认提示框/ }).click() - await page.getByRole('button', { name: '确定' }).click() - expect(notify).toHaveText('点击confirm按钮') - await page.getByRole('button', { name: /支持传入 jsx 提示框/ }).click() - await page.locator('.tiny-modal__close-btn').click() - await expect(confirm).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/basic-usage.vue b/examples/sites/demos/pc/app/modal/basic-usage.vue index 7e1fb7459b..284b140a03 100644 --- a/examples/sites/demos/pc/app/modal/basic-usage.vue +++ b/examples/sites/demos/pc/app/modal/basic-usage.vue @@ -1,10 +1,25 @@ @@ -13,7 +28,14 @@ import { Button, Modal, Notify } from '@opentiny/vue' export default { components: { - TinyButton: Button + TinyButton: Button, + TinyModal: Modal + }, + data() { + return { + show1: false, + show2: false + } }, methods: { baseClick() { @@ -23,9 +45,6 @@ export default { successClick() { Modal.alert({ message: '成功提示框', status: 'success' }) }, - errorClick() { - Modal.alert({ message: '失败提示框', title: '错误提示', status: 'error' }) - }, confirmClick() { Modal.confirm('您确定要删除吗?').then((res) => { Notify({ @@ -45,7 +64,21 @@ export default { ), status: 'success' }) + }, + messageClick() { + Modal.message('简单的消息') } } } + + diff --git a/examples/sites/demos/pc/app/modal/default-grid-composition-api.vue b/examples/sites/demos/pc/app/modal/default-grid-composition-api.vue deleted file mode 100644 index 2022c3ff57..0000000000 --- a/examples/sites/demos/pc/app/modal/default-grid-composition-api.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/modal/default-grid.spec.ts b/examples/sites/demos/pc/app/modal/default-grid.spec.ts deleted file mode 100644 index e92cc9ef3d..0000000000 --- a/examples/sites/demos/pc/app/modal/default-grid.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('嵌套grid', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#default-grid') - - const modal = page.locator('.tiny-modal') - const grid = modal.locator('.tiny-grid ').first() - await page.getByRole('button', { name: /默认插槽/ }).click() - await expect(grid).toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/default-grid.vue b/examples/sites/demos/pc/app/modal/default-grid.vue deleted file mode 100644 index b3c1f9d238..0000000000 --- a/examples/sites/demos/pc/app/modal/default-grid.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/modal/duration-composition-api.vue b/examples/sites/demos/pc/app/modal/duration-composition-api.vue deleted file mode 100644 index 507730c578..0000000000 --- a/examples/sites/demos/pc/app/modal/duration-composition-api.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/duration.spec.ts b/examples/sites/demos/pc/app/modal/duration.spec.ts deleted file mode 100644 index a8e8d435cb..0000000000 --- a/examples/sites/demos/pc/app/modal/duration.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('自动关闭延时', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#duration') - - const modal = page.locator('.tiny-modal.type__message') - await page.getByRole('button', { name: /3000ms/ }).click() - await expect(modal).toBeVisible() - await page.waitForTimeout(3200) - const visible1 = await modal.isVisible() - expect(visible1).toEqual(false) - - await page.getByRole('button', { name: /500ms/ }).click() - await expect(modal).toBeVisible() - await page.waitForTimeout(700) - const visible2 = await modal.isVisible() - expect(visible2).toEqual(false) - - await page.getByRole('button', { name: /5000ms/ }).click() - await expect(modal).toBeVisible() - const visible3 = await modal.isVisible() - expect(visible3).toEqual(true) -}) diff --git a/examples/sites/demos/pc/app/modal/duration.vue b/examples/sites/demos/pc/app/modal/duration.vue deleted file mode 100644 index 8c669789c3..0000000000 --- a/examples/sites/demos/pc/app/modal/duration.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/esc-closable-composition-api.vue b/examples/sites/demos/pc/app/modal/esc-closable-composition-api.vue deleted file mode 100644 index ed7388cd36..0000000000 --- a/examples/sites/demos/pc/app/modal/esc-closable-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/esc-closable.spec.ts b/examples/sites/demos/pc/app/modal/esc-closable.spec.ts deleted file mode 100644 index 1c178233de..0000000000 --- a/examples/sites/demos/pc/app/modal/esc-closable.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('按 Esc 键关闭弹出框', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#esc-closable') - - const modal = page.locator('.tiny-modal.type__alert.active') - await page.getByRole('button', { name: '按 Esc 键可以关闭弹出框' }).click() - await page.keyboard.press('Escape') - await expect(modal).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/esc-closable.vue b/examples/sites/demos/pc/app/modal/esc-closable.vue deleted file mode 100644 index b7d206edb2..0000000000 --- a/examples/sites/demos/pc/app/modal/esc-closable.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/event-composition-api.vue b/examples/sites/demos/pc/app/modal/event-composition-api.vue deleted file mode 100644 index ee078130d2..0000000000 --- a/examples/sites/demos/pc/app/modal/event-composition-api.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/event.spec.ts b/examples/sites/demos/pc/app/modal/event.spec.ts deleted file mode 100644 index c0ec904eeb..0000000000 --- a/examples/sites/demos/pc/app/modal/event.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('事件', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#event') - - const demo = page.locator('#event') - const messageModal = page.locator('.tiny-modal.type__message') - const modal = page.locator('.tiny-modal.type__confirm.active') - - // 显示、关闭事件 - await demo.getByRole('button', { name: '显示、关闭事件' }).click() - await expect(modal).toBeVisible() - await expect(messageModal.getByText('show 事件触发了')).toBeVisible() - await modal.getByRole('button', { name: '确定' }).click() - await expect(modal).not.toBeVisible() - await expect(messageModal.getByText('show 事件触发了')).toBeVisible() - - // 确认、取消事件 - await demo.getByRole('button', { name: '确认、取消事件' }).click() - await expect(modal).toBeVisible() - await modal.getByRole('button', { name: '确定' }).click() - await expect(modal).not.toBeVisible() - await expect(messageModal.getByText('confirm 事件触发了')).toBeVisible() - await demo.getByRole('button', { name: '确认、取消事件' }).click() - await expect(modal).toBeVisible() - await modal.getByRole('button', { name: '取消' }).click() - await expect(modal).not.toBeVisible() - await expect(messageModal.getByText('cancel 事件触发了')).toBeVisible() - - // 关闭点击事件 - await demo.getByRole('button', { name: '关闭点击事件' }).click() - await modal.locator('.tiny-modal__close-btn').click() - await expect(messageModal.getByText('close 事件触发了')).toBeVisible() - await expect(modal).not.toBeVisible() - - // 缩放事件 - await demo.getByRole('button', { name: '缩放事件' }).click() - await modal.locator('.tiny-modal__zoom-btn').click() - await expect(messageModal.getByText('zoom 事件触发了')).toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/event.vue b/examples/sites/demos/pc/app/modal/event.vue deleted file mode 100644 index e43df53f2f..0000000000 --- a/examples/sites/demos/pc/app/modal/event.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-btn-content-composition-api.vue b/examples/sites/demos/pc/app/modal/footer-btn-content-composition-api.vue deleted file mode 100644 index cda2e57214..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-content-composition-api.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-btn-content.spec.ts b/examples/sites/demos/pc/app/modal/footer-btn-content.spec.ts deleted file mode 100644 index b07a477837..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-content.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('自定义确定按钮文本', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#footer-btn-content') - - const demo = page.locator('#footer-btn-content') - const modal = page.locator('.tiny-modal.active') - const confirmBtn = modal.locator('.tiny-modal__footer .tiny-button--primary') - const cancelBtn = modal.locator('.tiny-modal__footer .tiny-button--default') - - await demo.getByRole('button', { name: '方法调用' }).click() - await expect(confirmBtn).toHaveText('好的') - await expect(cancelBtn).toHaveText('返回') - await confirmBtn.click() - - await demo.getByRole('button', { name: '组件形式使用' }).click() - await expect(confirmBtn).toHaveText('确定') - await expect(cancelBtn).toHaveText('再想想') - await confirmBtn.click() -}) diff --git a/examples/sites/demos/pc/app/modal/footer-btn-content.vue b/examples/sites/demos/pc/app/modal/footer-btn-content.vue deleted file mode 100644 index a2bec8495f..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-content.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-btn-props-composition-api.vue b/examples/sites/demos/pc/app/modal/footer-btn-props-composition-api.vue deleted file mode 100644 index 808a46e2ab..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-props-composition-api.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-btn-props.spec.ts b/examples/sites/demos/pc/app/modal/footer-btn-props.spec.ts deleted file mode 100644 index 0351e26abb..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-props.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { test, expect } from '@playwright/test' - -test.describe('自定义底部按钮', () => { - test('确认按钮Props', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#footer-btn-props') - - const modal = page.locator('.tiny-modal') - const confirmBtn1 = modal.locator('.tiny-modal__footer .tiny-button--primary').nth(1) - const confirmBtn2 = modal.locator('.tiny-modal__footer .tiny-button--primary').first() - - await page.getByRole('button', { name: '方法调用' }).click() - await expect(confirmBtn1).toHaveClass(/is-disabled/) - await expect(confirmBtn1).toHaveText('OK') - await modal.locator('.tiny-modal__header > .tiny-modal__close-btn').nth(1).click() - - await page.getByRole('button', { name: '组件形式使用' }).click() - await expect(confirmBtn2).toHaveAttribute('autoFocus', 'true') - }) - - test('取消按钮Props', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#footer-btn-props') - - const modal = page.locator('.tiny-modal') - const cancelBtn1 = modal.locator('.tiny-modal__footer .tiny-button--default').first() - const cancelBtn2 = modal.getByRole('button', { name: '取消' }) - - await page.getByRole('button', { name: '方法调用' }).click() - await expect(cancelBtn1).toHaveClass(/is-plain/) - await expect(cancelBtn1).toHaveText('返回') - await modal.locator('.tiny-modal__header > .tiny-modal__close-btn').nth(1).click() - - await page.getByRole('button', { name: '组件形式使用' }).click() - await expect(cancelBtn2).toHaveClass(/tiny-button--warning/) - }) -}) diff --git a/examples/sites/demos/pc/app/modal/footer-btn-props.vue b/examples/sites/demos/pc/app/modal/footer-btn-props.vue deleted file mode 100644 index b62a7767b2..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-btn-props.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-slot-composition-api.vue b/examples/sites/demos/pc/app/modal/footer-slot-composition-api.vue deleted file mode 100644 index 0730703e0a..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-slot-composition-api.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/footer-slot.spec.ts b/examples/sites/demos/pc/app/modal/footer-slot.spec.ts deleted file mode 100644 index 774d3d2b2d..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-slot.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('底部插槽', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#footer-slot') - - const modal = page.locator('.tiny-modal') - await page.getByRole('button', { name: /自定义底部/ }).click() - await expect(modal.getByRole('button', { name: /自定义底部信息/ })).toBeVisible() - await modal.getByRole('button', { name: /自定义底部信息/ }).click() -}) diff --git a/examples/sites/demos/pc/app/modal/footer-slot.vue b/examples/sites/demos/pc/app/modal/footer-slot.vue deleted file mode 100644 index 48e162ca85..0000000000 --- a/examples/sites/demos/pc/app/modal/footer-slot.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/fullscreen-composition-api.vue b/examples/sites/demos/pc/app/modal/fullscreen-composition-api.vue deleted file mode 100644 index 829c91af8b..0000000000 --- a/examples/sites/demos/pc/app/modal/fullscreen-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/fullscreen.spec.ts b/examples/sites/demos/pc/app/modal/fullscreen.spec.ts deleted file mode 100644 index 815e6bd143..0000000000 --- a/examples/sites/demos/pc/app/modal/fullscreen.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('最大化显示', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#fullscreen') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '最大化显示' }).click() - await expect(modal).toHaveClass(/is__maximize/) - await page.locator('.tiny-modal__close-btn').click() - await expect(modal).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/fullscreen.vue b/examples/sites/demos/pc/app/modal/fullscreen.vue deleted file mode 100644 index 6a505d8799..0000000000 --- a/examples/sites/demos/pc/app/modal/fullscreen.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/id-composition-api.vue b/examples/sites/demos/pc/app/modal/id-composition-api.vue deleted file mode 100644 index fdc8e13a7d..0000000000 --- a/examples/sites/demos/pc/app/modal/id-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/id.spec.ts b/examples/sites/demos/pc/app/modal/id.spec.ts deleted file mode 100644 index 271819ea8e..0000000000 --- a/examples/sites/demos/pc/app/modal/id.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('防止重复提示', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#id') - - const demo = page.locator('#id') - - await demo.getByRole('button', { name: '不允许重复点击' }).click() - await demo.getByRole('button', { name: '不允许重复点击' }).click() - await demo.getByRole('button', { name: '不允许重复点击' }).click() - await expect(page.locator('.tiny-modal')).toHaveCount(1) -}) diff --git a/examples/sites/demos/pc/app/modal/id.vue b/examples/sites/demos/pc/app/modal/id.vue deleted file mode 100644 index 057f88bd46..0000000000 --- a/examples/sites/demos/pc/app/modal/id.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/is-form-reset-composition-api.vue b/examples/sites/demos/pc/app/modal/is-form-reset-composition-api.vue deleted file mode 100644 index a225922c4f..0000000000 --- a/examples/sites/demos/pc/app/modal/is-form-reset-composition-api.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/is-form-reset.spec.ts b/examples/sites/demos/pc/app/modal/is-form-reset.spec.ts deleted file mode 100644 index da39ebe00a..0000000000 --- a/examples/sites/demos/pc/app/modal/is-form-reset.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('关闭弹窗,是否重置表单数据', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#is-form-reset') - - const demo = page.locator('#is-form-reset') - const modal = page.locator('.tiny-modal.active') - - await demo.getByRole('button', { name: '关闭是否重置表单' }).click() - await modal.locator('form input[type="text"]').click() - await modal.locator('form input[type="text"]').fill('name') - await modal.locator('input[type="password"]').click() - await modal.locator('input[type="password"]').fill('123') - await modal.getByRole('button', { name: '取消' }).click() - await demo.getByRole('button', { name: '关闭是否重置表单' }).click() - await expect(modal.locator('form input[type="text"]')).toHaveValue('name') - await expect(modal.locator('input[type="password"]')).toHaveValue('123') -}) diff --git a/examples/sites/demos/pc/app/modal/is-form-reset.vue b/examples/sites/demos/pc/app/modal/is-form-reset.vue deleted file mode 100644 index aebef4b488..0000000000 --- a/examples/sites/demos/pc/app/modal/is-form-reset.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/lock-scroll-composition-api.vue b/examples/sites/demos/pc/app/modal/lock-scroll-composition-api.vue deleted file mode 100644 index 29b0ada350..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-scroll-composition-api.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/lock-scroll.spec.ts b/examples/sites/demos/pc/app/modal/lock-scroll.spec.ts deleted file mode 100644 index 8ec6b7b671..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-scroll.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('锁住滚动条', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#lock-scroll') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '不锁住滚动条不要遮罩层' }).click() - await expect(modal).not.toHaveClass(/lock__scroll/) - - // 上下滑动模态框内容 - const { y: initY } = await modal.locator('.tiny-modal__box').boundingBox() - await page.mouse.wheel(0, 100) - await page.waitForTimeout(100) - const { y: afterY } = await modal.locator('.tiny-modal__box').boundingBox() - expect(afterY).toBeLessThan(initY) -}) diff --git a/examples/sites/demos/pc/app/modal/lock-scroll.vue b/examples/sites/demos/pc/app/modal/lock-scroll.vue deleted file mode 100644 index 8b29aab6fd..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-scroll.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/lock-view-composition-api.vue b/examples/sites/demos/pc/app/modal/lock-view-composition-api.vue deleted file mode 100644 index f8c679a099..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-view-composition-api.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/lock-view.spec.ts b/examples/sites/demos/pc/app/modal/lock-view.spec.ts deleted file mode 100644 index dd5d63fb99..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-view.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('锁住页面', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#lock-view') - - const modal = page.locator('.tiny-modal.active') - - // 新版示例页单示例无滚动条,先展开代码保证有滚动条 - await page.locator('.i-ti-code').click() - await page.waitForTimeout(100) - - await page.getByRole('button', { name: '不锁界面 且 隐藏遮罩层' }).click() - await expect(modal).not.toHaveClass(/lock__view/) - - // 检查页面元素是否随鼠标滑轮滚动而移动 - const { y: initY } = await page.locator('#lock-view').boundingBox() - await page.mouse.wheel(0, 100) - await page.waitForTimeout(100) - const { y: afterY } = await page.locator('#lock-view').boundingBox() - expect(initY).toBeGreaterThan(afterY) -}) - -test('控制遮罩层显示', async ({ page }) => { - await page.goto('modal#lock-view') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '不锁界面 且 隐藏遮罩层' }).click() - await expect(modal).not.toHaveClass(/is__mask/) -}) diff --git a/examples/sites/demos/pc/app/modal/lock-view.vue b/examples/sites/demos/pc/app/modal/lock-view.vue deleted file mode 100644 index 6a3cca329b..0000000000 --- a/examples/sites/demos/pc/app/modal/lock-view.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/mask-closable-composition-api.vue b/examples/sites/demos/pc/app/modal/mask-closable-composition-api.vue deleted file mode 100644 index 106198f382..0000000000 --- a/examples/sites/demos/pc/app/modal/mask-closable-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/mask-closable.spec.ts b/examples/sites/demos/pc/app/modal/mask-closable.spec.ts deleted file mode 100644 index bec5307284..0000000000 --- a/examples/sites/demos/pc/app/modal/mask-closable.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('点击遮罩层关闭窗口', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#mask-closable') - - await page.getByRole('button', { name: '点击遮罩层可以关闭' }).click() - await expect(page.locator('.tiny-modal.active')).toBeVisible() - await page.mouse.click(10, 10) - await expect(page.locator('.tiny-modal.active')).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/mask-closable.vue b/examples/sites/demos/pc/app/modal/mask-closable.vue deleted file mode 100644 index 41f708f3d7..0000000000 --- a/examples/sites/demos/pc/app/modal/mask-closable.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/message-closable.spec.ts b/examples/sites/demos/pc/app/modal/message-closable.spec.ts deleted file mode 100644 index 68f4f816dd..0000000000 --- a/examples/sites/demos/pc/app/modal/message-closable.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('关闭消息弹窗', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#message-closable') - - const demo = page.locator('#message-closable') - const modal = page.locator('.tiny-modal.active') - - await demo.getByRole('button', { name: '关闭按钮示例' }).click() - await expect(modal.locator('.tiny-modal__close-btn')).toBeVisible() - await modal.locator('.tiny-modal__close-btn').click() - await expect(modal).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/message-close-composition-api.vue b/examples/sites/demos/pc/app/modal/message-close-composition-api.vue new file mode 100644 index 0000000000..eba35f6c48 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-close-composition-api.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-close.vue b/examples/sites/demos/pc/app/modal/message-close.vue new file mode 100644 index 0000000000..a61177fb65 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-close.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-composition-api.vue b/examples/sites/demos/pc/app/modal/message-composition-api.vue deleted file mode 100644 index 3231929788..0000000000 --- a/examples/sites/demos/pc/app/modal/message-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/message-event-composition-api.vue b/examples/sites/demos/pc/app/modal/message-event-composition-api.vue new file mode 100644 index 0000000000..928ef8cc13 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-event-composition-api.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-event.vue b/examples/sites/demos/pc/app/modal/message-event.vue new file mode 100644 index 0000000000..126dd2b129 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-event.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-id-composition-api.vue b/examples/sites/demos/pc/app/modal/message-id-composition-api.vue new file mode 100644 index 0000000000..5f9d4aedba --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-id-composition-api.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-id.vue b/examples/sites/demos/pc/app/modal/message-id.vue new file mode 100644 index 0000000000..81b0a3d8a8 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-id.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-top-composition-api.vue b/examples/sites/demos/pc/app/modal/message-top-composition-api.vue new file mode 100644 index 0000000000..28f47d53b1 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-top-composition-api.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message-top.vue b/examples/sites/demos/pc/app/modal/message-top.vue new file mode 100644 index 0000000000..3f614ef3be --- /dev/null +++ b/examples/sites/demos/pc/app/modal/message-top.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/message.spec.ts b/examples/sites/demos/pc/app/modal/message.spec.ts deleted file mode 100644 index 1984a47413..0000000000 --- a/examples/sites/demos/pc/app/modal/message.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('自定义内容', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#message') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '自定义提示框的内容' }).click() - await expect(modal.locator('.tiny-modal__content').getByText('11111')).toHaveCSS('color', 'rgb(250, 152, 65)') -}) diff --git a/examples/sites/demos/pc/app/modal/message.vue b/examples/sites/demos/pc/app/modal/message.vue deleted file mode 100644 index 0a6e89792f..0000000000 --- a/examples/sites/demos/pc/app/modal/message.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue b/examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue deleted file mode 100644 index 3ba93000df..0000000000 --- a/examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/min-width-height.spec.ts b/examples/sites/demos/pc/app/modal/min-width-height.spec.ts deleted file mode 100644 index c191c496b7..0000000000 --- a/examples/sites/demos/pc/app/modal/min-width-height.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('调整窗口后显示的最小宽高度', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#min-width-height') - - await page.getByRole('button', { name: /最小宽高度/ }).click() - const modal = page.locator('.tiny-modal.active .tiny-modal__box') - // 获取弹窗位置 - const { x, y } = await modal.boundingBox() - // 开始横线拖动 - await page.mouse.move(x, y) - await page.mouse.down() - await page.mouse.move(x + 100, y) - await page.mouse.move(x + 300, y) - await page.mouse.up() - - // 判断窗口宽度是否小于限定最小宽度 - const { width } = await modal.boundingBox() - expect(Math.round(width)).not.toBeLessThan(700) -}) diff --git a/examples/sites/demos/pc/app/modal/min-width-height.vue b/examples/sites/demos/pc/app/modal/min-width-height.vue deleted file mode 100644 index 9db925f5b9..0000000000 --- a/examples/sites/demos/pc/app/modal/min-width-height.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/modal-event-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-event-composition-api.vue new file mode 100644 index 0000000000..36ba3dcb1a --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-event-composition-api.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-event.vue b/examples/sites/demos/pc/app/modal/modal-event.vue new file mode 100644 index 0000000000..eaaccc5d24 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-event.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-fn-slots-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-fn-slots-composition-api.vue new file mode 100644 index 0000000000..1f368900a5 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-fn-slots-composition-api.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-fn-slots.vue b/examples/sites/demos/pc/app/modal/modal-fn-slots.vue new file mode 100644 index 0000000000..4a3d4d7f72 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-fn-slots.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-footer-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-footer-composition-api.vue new file mode 100644 index 0000000000..66b9708cb2 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-footer-composition-api.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-footer.vue b/examples/sites/demos/pc/app/modal/modal-footer.vue new file mode 100644 index 0000000000..3706362236 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-footer.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-header-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-header-composition-api.vue new file mode 100644 index 0000000000..a4d81c2c8e --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-header-composition-api.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-header.vue b/examples/sites/demos/pc/app/modal/modal-header.vue new file mode 100644 index 0000000000..0820c67393 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-header.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-lock-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-lock-composition-api.vue new file mode 100644 index 0000000000..abe6ac1af6 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-lock-composition-api.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-lock.vue b/examples/sites/demos/pc/app/modal/modal-lock.vue new file mode 100644 index 0000000000..ac5e070fed --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-lock.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-mask-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-mask-composition-api.vue new file mode 100644 index 0000000000..43797fd544 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-mask-composition-api.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-mask.vue b/examples/sites/demos/pc/app/modal/modal-mask.vue new file mode 100644 index 0000000000..2ac758e5f1 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-mask.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-other-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-other-composition-api.vue new file mode 100644 index 0000000000..d252274632 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-other-composition-api.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-other.vue b/examples/sites/demos/pc/app/modal/modal-other.vue new file mode 100644 index 0000000000..4c509fb989 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-other.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-resize-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-resize-composition-api.vue new file mode 100644 index 0000000000..e83e8f81df --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-resize-composition-api.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-resize.vue b/examples/sites/demos/pc/app/modal/modal-resize.vue new file mode 100644 index 0000000000..1dfde4f9b7 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-resize.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-size-composition-api.vue b/examples/sites/demos/pc/app/modal/modal-size-composition-api.vue new file mode 100644 index 0000000000..1f232c6e1c --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-size-composition-api.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/modal-size.vue b/examples/sites/demos/pc/app/modal/modal-size.vue new file mode 100644 index 0000000000..c2856b07b6 --- /dev/null +++ b/examples/sites/demos/pc/app/modal/modal-size.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/examples/sites/demos/pc/app/modal/prop-slots-composition-api.vue b/examples/sites/demos/pc/app/modal/prop-slots-composition-api.vue deleted file mode 100644 index d8c1eb2c22..0000000000 --- a/examples/sites/demos/pc/app/modal/prop-slots-composition-api.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/prop-slots.spec.ts b/examples/sites/demos/pc/app/modal/prop-slots.spec.ts deleted file mode 100644 index 76a0d9c029..0000000000 --- a/examples/sites/demos/pc/app/modal/prop-slots.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('调整窗口后显示的最小宽度', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#prop-slots') - await page.getByRole('button', { name: '打开提示框' }).click() - await page.getByRole('button', { name: '点我确定' }).click() - await page.getByRole('button', { name: '打开提示框' }).click() - await page.getByRole('button', { name: '点我取消' }).click() -}) diff --git a/examples/sites/demos/pc/app/modal/prop-slots.vue b/examples/sites/demos/pc/app/modal/prop-slots.vue deleted file mode 100644 index 0390c81d03..0000000000 --- a/examples/sites/demos/pc/app/modal/prop-slots.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/resize-composition-api.vue b/examples/sites/demos/pc/app/modal/resize-composition-api.vue deleted file mode 100644 index 16e0376910..0000000000 --- a/examples/sites/demos/pc/app/modal/resize-composition-api.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/resize.spec.ts b/examples/sites/demos/pc/app/modal/resize.spec.ts deleted file mode 100644 index 57e135b086..0000000000 --- a/examples/sites/demos/pc/app/modal/resize.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('调整窗口大小', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#resize') - - await page.getByRole('button', { name: '可以拖动调整窗口大小' }).click() - const modal = page.locator('.tiny-modal.active .tiny-modal__box') - - // 获取弹窗位置 - const { x, y, width, height } = await modal.boundingBox() - - // 开始拖动放大 - await page.mouse.move(x, y) - await page.mouse.down() - await page.mouse.move(x + 100, y + 100) - await page.mouse.move(x - 50, y) - await expect(modal).toHaveClass(/is__drag/) - await page.mouse.up() - - // 判断窗口尺寸是否放大 - const { width: finalWidth, height: finalHeight } = await modal.boundingBox() - expect(width).toBeLessThan(finalWidth) - expect(height).toBeLessThan(finalHeight) -}) diff --git a/examples/sites/demos/pc/app/modal/resize.vue b/examples/sites/demos/pc/app/modal/resize.vue deleted file mode 100644 index ec68fa0165..0000000000 --- a/examples/sites/demos/pc/app/modal/resize.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/show-header-footer-composition-api.vue b/examples/sites/demos/pc/app/modal/show-header-footer-composition-api.vue deleted file mode 100644 index 694ab6283c..0000000000 --- a/examples/sites/demos/pc/app/modal/show-header-footer-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/show-header-footer.spec.ts b/examples/sites/demos/pc/app/modal/show-header-footer.spec.ts deleted file mode 100644 index 60c77943fe..0000000000 --- a/examples/sites/demos/pc/app/modal/show-header-footer.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('控制显示头部及底部', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#show-header-footer') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: /控制显示头部及底部/ }).click() - await expect(modal.locator('.tiny-modal__header')).toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/show-header-footer.vue b/examples/sites/demos/pc/app/modal/show-header-footer.vue deleted file mode 100644 index 188b9709bc..0000000000 --- a/examples/sites/demos/pc/app/modal/show-header-footer.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/status-composition-api.vue b/examples/sites/demos/pc/app/modal/status-composition-api.vue index 43038dc4cd..73341a4284 100644 --- a/examples/sites/demos/pc/app/modal/status-composition-api.vue +++ b/examples/sites/demos/pc/app/modal/status-composition-api.vue @@ -1,33 +1,93 @@ + + diff --git a/examples/sites/demos/pc/app/modal/status.spec.ts b/examples/sites/demos/pc/app/modal/status.spec.ts deleted file mode 100644 index 03ae6aff0c..0000000000 --- a/examples/sites/demos/pc/app/modal/status.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('消息状态', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#status') - - const messageInfo = page.locator('.tiny-modal').filter({ hasText: '基本提示图标' }) - await page.getByRole('button', { name: '基本提示图标' }).click() - await expect(messageInfo).toHaveClass(/type__message/) - await expect(messageInfo).toHaveClass(/status__info/) - await expect(messageInfo.locator('.tiny-modal__status-wrapper .tiny-svg')).toHaveClass(/tiny-modal-svg__info/) - - const messageSucc = page.locator('.tiny-modal').filter({ hasText: '成功提示图标' }) - await page.getByRole('button', { name: '成功提示图标' }).click() - await expect(messageSucc).toHaveClass(/status__success/) - await expect(messageSucc.locator('.tiny-modal__status-wrapper .tiny-svg')).toHaveClass(/tiny-modal-svg__success/) - - const messageWarn = page.locator('.tiny-modal').filter({ hasText: '警告提示图标' }) - await page.getByRole('button', { name: '警告提示图标' }).click() - await expect(messageWarn).toHaveClass(/status__warning/) - await expect(messageWarn.locator('.tiny-modal__status-wrapper .tiny-svg')).toHaveClass(/tiny-modal-svg__warning/) - - const messageError = page.locator('.tiny-modal').filter({ hasText: '错误提示图标' }) - await page.getByRole('button', { name: '错误提示图标' }).click() - await expect(messageError).toHaveClass(/status__error/) - await expect(messageError.locator('.tiny-modal__status-wrapper .tiny-svg')).toHaveClass(/tiny-modal-svg__error/) - - const messageHasLoadingBtn = page.locator('.tiny-modal').filter({ hasText: '加载提示图标' }) - const loadingBtn = messageHasLoadingBtn.locator('.tiny-modal-svg__refresh') - await page.getByRole('button', { name: '加载提示图标' }).click() - await expect(loadingBtn).toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/status.vue b/examples/sites/demos/pc/app/modal/status.vue index cbbf183e98..a17454cba7 100644 --- a/examples/sites/demos/pc/app/modal/status.vue +++ b/examples/sites/demos/pc/app/modal/status.vue @@ -1,10 +1,30 @@ @@ -13,24 +33,67 @@ import { Button, Modal } from '@opentiny/vue' export default { components: { - TinyButton: Button + TinyButton: Button, + TinyModal: Modal + }, + data() { + return { + show: false, + status: '' + } }, methods: { - baseClick() { - Modal.message({ message: '基本提示图标', status: 'info' }) + infoClick(mode) { + mode === 1 && Modal.alert({ message: '基本提示图标', status: 'info' }) + mode === 2 && Modal.message({ message: '基本提示图标', status: 'info' }) + if (mode === 3) { + this.status = 'info' + this.show = true + } }, - successClick() { - Modal.message({ message: '成功提示图标', status: 'success' }) + successClick(mode) { + mode === 1 && Modal.alert({ message: '成功提示图标', status: 'success' }) + mode === 2 && Modal.message({ message: '成功提示图标', status: 'success' }) + if (mode === 3) { + this.status = 'success' + this.show = true + } }, - warningClick() { - Modal.message({ message: '警告提示图标', status: 'warning' }) + warningClick(mode) { + mode === 1 && Modal.alert({ message: '警告提示图标', status: 'warning' }) + mode === 2 && Modal.message({ message: '警告提示图标', status: 'warning' }) + if (mode === 3) { + this.status = 'warning' + this.show = true + } }, - errorClick() { - Modal.message({ message: '错误提示图标', status: 'error' }) + errorClick(mode) { + mode === 1 && Modal.alert({ message: '错误提示图标', status: 'error' }) + mode === 2 && Modal.message({ message: '错误提示图标', status: 'error' }) + if (mode === 3) { + this.status = 'error' + this.show = true + } }, - loadingClick() { - Modal.message({ message: '加载提示图标', status: 'loading' }) + loadingClick(mode) { + mode === 1 && Modal.alert({ message: '加载提示图标', status: 'loading' }) + mode === 2 && Modal.message({ message: '加载提示图标', status: 'loading' }) + if (mode === 3) { + this.status = 'loading' + this.show = true + } } } } + + diff --git a/examples/sites/demos/pc/app/modal/title-composition-api.vue b/examples/sites/demos/pc/app/modal/title-composition-api.vue deleted file mode 100644 index b399cf825f..0000000000 --- a/examples/sites/demos/pc/app/modal/title-composition-api.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/title.spec.ts b/examples/sites/demos/pc/app/modal/title.spec.ts deleted file mode 100644 index 69d222d4ab..0000000000 --- a/examples/sites/demos/pc/app/modal/title.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('自定义标题', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#title') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '自定义标题' }).click() - await expect(modal.locator('.tiny-modal__header')).toHaveText('自定义标题') -}) - -test('无标题', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#title') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '无标题' }).click() - await expect(modal.locator('.tiny-modal__title')).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/title.vue b/examples/sites/demos/pc/app/modal/title.vue deleted file mode 100644 index 733a146283..0000000000 --- a/examples/sites/demos/pc/app/modal/title.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/top-composition-api.vue b/examples/sites/demos/pc/app/modal/top-composition-api.vue deleted file mode 100644 index a0e6227faf..0000000000 --- a/examples/sites/demos/pc/app/modal/top-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/top.spec.ts b/examples/sites/demos/pc/app/modal/top.spec.ts deleted file mode 100644 index 4d9afdf67c..0000000000 --- a/examples/sites/demos/pc/app/modal/top.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('距离顶部的位置', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#top') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '距离顶部的位置为500' }).click() - await expect(modal).toHaveCSS('top', '500px') -}) diff --git a/examples/sites/demos/pc/app/modal/top.vue b/examples/sites/demos/pc/app/modal/top.vue deleted file mode 100644 index 64b1ba3f74..0000000000 --- a/examples/sites/demos/pc/app/modal/top.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/type-composition-api.vue b/examples/sites/demos/pc/app/modal/type-composition-api.vue deleted file mode 100644 index 08233b64b2..0000000000 --- a/examples/sites/demos/pc/app/modal/type-composition-api.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/type.spec.ts b/examples/sites/demos/pc/app/modal/type.spec.ts deleted file mode 100644 index 59d2ec5628..0000000000 --- a/examples/sites/demos/pc/app/modal/type.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('窗口类型', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#type') - - const alert = page.locator('.tiny-modal').filter({ hasText: 'alert 弹框' }) - await page.getByRole('button', { name: 'alert 弹框' }).click() - await expect(alert).toBeVisible() - await expect(alert).toHaveClass(/type__alert/) - await page.getByRole('button', { name: '确定', exact: true }).click() - - const message = page.locator('.tiny-modal').filter({ hasText: 'message 提示框' }) - await page.getByRole('button', { name: 'message 提示框' }).click() - await expect(message).toBeVisible() - await expect(message).toHaveClass(/type__message/) - - const confirm = page.locator('.tiny-modal').filter({ hasText: '确定框' }) - await page.getByRole('button', { name: 'confirm 确认提示框' }).click() - await expect(confirm).toBeVisible() - await expect(confirm).toHaveClass(/type__confirm/) -}) diff --git a/examples/sites/demos/pc/app/modal/type.vue b/examples/sites/demos/pc/app/modal/type.vue deleted file mode 100644 index bf1c21f2a1..0000000000 --- a/examples/sites/demos/pc/app/modal/type.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/value-composition-api.vue b/examples/sites/demos/pc/app/modal/value-composition-api.vue deleted file mode 100644 index 77fb84862c..0000000000 --- a/examples/sites/demos/pc/app/modal/value-composition-api.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/modal/value.spec.ts b/examples/sites/demos/pc/app/modal/value.spec.ts deleted file mode 100644 index b030c09fa5..0000000000 --- a/examples/sites/demos/pc/app/modal/value.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('控制弹窗显示隐藏的绑定值', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#value') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: '默认插槽' }).click() - await expect(modal).toHaveClass(/is__visible/) - await expect(modal).toBeVisible() - await expect(modal.locator('.custom-content')).toHaveText('test') - await expect(modal.locator('.custom-content')).toHaveCSS('color', 'rgb(49, 104, 241)') - await page.getByRole('button', { name: '确定' }).click() - await expect(modal).not.toHaveClass(/is__visible/) - await expect(modal).not.toBeVisible() -}) diff --git a/examples/sites/demos/pc/app/modal/value.vue b/examples/sites/demos/pc/app/modal/value.vue deleted file mode 100644 index 76141d2205..0000000000 --- a/examples/sites/demos/pc/app/modal/value.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/examples/sites/demos/pc/app/modal/webdoc/modal.cn.md b/examples/sites/demos/pc/app/modal/webdoc/modal.cn.md index cd6fc0fb49..a5ad7891f9 100644 --- a/examples/sites/demos/pc/app/modal/webdoc/modal.cn.md +++ b/examples/sites/demos/pc/app/modal/webdoc/modal.cn.md @@ -4,4 +4,4 @@ title: Modal 模态框 # Modal 模态框 -
模态对话框。
+
模态对话框和消息提示。
diff --git a/examples/sites/demos/pc/app/modal/webdoc/modal.en.md b/examples/sites/demos/pc/app/modal/webdoc/modal.en.md index 4ae58eb35e..2e051b684b 100644 --- a/examples/sites/demos/pc/app/modal/webdoc/modal.en.md +++ b/examples/sites/demos/pc/app/modal/webdoc/modal.en.md @@ -1,7 +1,7 @@ --- -title: Modal dialog box +title: Modal --- -# Modal dialog box +# Modal -
Modal dialog box.
+
Modal and messages.
diff --git a/examples/sites/demos/pc/app/modal/webdoc/modal.js b/examples/sites/demos/pc/app/modal/webdoc/modal.js index 0c0d6a41d2..13c639dcd4 100644 --- a/examples/sites/demos/pc/app/modal/webdoc/modal.js +++ b/examples/sites/demos/pc/app/modal/webdoc/modal.js @@ -9,334 +9,333 @@ export default { 'en-US': 'Basic Usage' }, desc: { - 'zh-CN': - '

可通过Modal.alert方法设置弹出框,Modal.confirm方法设置确认弹出框。函数返回一个Promise对象,其中属性vm可用来关闭当前模态框。

', - 'en-US': - '

You can use the Modal.alert method to set a pop-up box, and use the Modal.confirm method to set a confirmation pop-up box. The function returns a Promise object, where the property vm can be used to close the current Modal.

' + 'zh-CN': ` + Modal 组件有2种调用方法:函数式调用标签式调用
+
+

函数式调用

+ 通过调用Modal对象下的 alertconfirmmessage方法调用弹窗组件。
+ 函数入参:支持(message:string, title:string, options: Object)(options: Object) 两种形式。 + 其中 options 对象支持Modal 组件的部分属性值,比如 message, title, status 等。
+ 函数返回:返回值为一个Promise对象,其中属性vm可用来关闭当前模态框
+
+
+

标签式调用

+ Modal 对象自身也是一个标准的Vue 组件,通过modelValue 属性控制弹窗的显示和隐藏。 +
+
+

特别提示:

+ 1、message 的消息模式,只支持函数式调用。
+ 2、消息模式和模态窗模式很多属性不共用,比如消息模式就不支持title 等属性。 +
+ `, + 'en-US': ` + The Modal component has two calls: the function call and the tag call .
+
+

Function call

+ You can do this by calling the alert, confirm, and message methods under the Modal object.
+ Function entry: Support (message:string, title:string, options: Object) or (options: Object) two forms. + The options object supports some property values of the Modal component, such as message, title, status and so on.
+ Function return: The return value is a Promise object where the property vm can be used to close the current mode box
+
+ +
+

Tag call

+ The Modal object itself is also a standard Vue component that controls the display and hiding of pop-ups through the modelValue property. +
+ +
+

Special note:

+ 1, message message mode, only support functional call.
+ 2, message mode and mode window mode many attributes do not share, for example, message mode does not support title and other attributes. +
+` }, codeFiles: ['basic-usage.vue'] }, { - demoId: 'fullscreen', - name: { - 'zh-CN': '最大化显示', - 'en-US': 'Maximized Display' - }, - desc: { - 'zh-CN': '

可通过fullscreen属性设置是否最大化显示。

', - 'en-US': '

You can use the fullscreen attribute to set whether to maximize the display.

' - }, - codeFiles: ['fullscreen.vue'] - }, - { - demoId: 'esc-closable', - name: { - 'zh-CN': '按 Esc 键关闭弹出框', - 'en-US': 'Press Esc To Close The Dialog Box.' - }, - desc: { - 'zh-CN': '

可通过esc-closable属性设置是否允许按 Esc 键关闭窗口。

', - 'en-US': - '

You can use the esc-closable attribute to set whether to close a window by pressing the Esc key.

' - }, - codeFiles: ['esc-closable.vue'] - }, - { - demoId: 'duration', - name: { - 'zh-CN': '自动关闭延时', - 'en-US': 'Automatic Shutdown Delay' - }, - desc: { - 'zh-CN': "

可通过duration属性设置自动关闭的延迟时间,仅当type='message'有效。

", - 'en-US': - '

You can use the duration attribute to set the delay time for automatic closing. This parameter is valid only for type=message.

' - }, - codeFiles: ['duration.vue'] - }, - { - demoId: 'id', - name: { - 'zh-CN': '防止重复提示', - 'en-US': 'Prevent Repeated Prompts' - }, - desc: { - 'zh-CN': "

可通过id设置防止重复提示,仅当type='message'有效。

", - 'en-US': - '

If you do not want to click the window repeatedly, you can set a unique id to prevent repeated prompts. This parameter is valid only for type=message.

' - }, - codeFiles: ['id.vue'] - }, - { - demoId: 'lock-scroll', - name: { - 'zh-CN': '锁住滚动条', - 'en-US': 'Lock The Scroll Bar' - }, - desc: { - 'zh-CN': '

可通过lock-scroll属性设置是否锁住滚动条,不允许页面滚动。

', - 'en-US': '

You can use the lock-scroll attribute to set whether to lock the scroll bar.

' - }, - codeFiles: ['lock-scroll.vue'] - }, - { - demoId: 'lock-view', + demoId: 'status', name: { - 'zh-CN': '锁住页面', - 'en-US': 'Lock The Page' + 'zh-CN': '状态和图标', + 'en-US': 'Status and ICONS' }, desc: { 'zh-CN': - '

可通过mask属性设置是否显示遮罩层,lock-view属性设置是否锁住页面,不允许窗口之外的任何操作。

', + '通过status属性设置组件状态,可选值有infosuccesswarningerrorloading,每种状态有相应的状态图标。', 'en-US': - 'You can set whether to display the mask layer through themaskattribute, and whether to lock the page and not allow any operations outside the window through thelock-viewattribute' + 'Use the status property to set the component state, Optional values are info, success, warning, error, and loading. Each state has a corresponding status icon.' }, - codeFiles: ['lock-view.vue'] + codeFiles: ['status.vue'] }, + { - demoId: 'mask-closable', + demoId: 'modal-header', name: { - 'zh-CN': '点击遮罩层关闭窗口', - 'en-US': 'Click The Mask Layer To Close The Window.' + 'zh-CN': '自定义弹窗标题', + 'en-US': 'Custom Modal title' }, desc: { - 'zh-CN': '

可通过mask-closable属性设置是否允许点击遮罩层关闭窗口。

', - 'en-US': - '

You can use the mask-closable attribute to set whether to allow clicking the mask layer to close the window.

' - }, - codeFiles: ['mask-closable.vue'] + 'zh-CN': ` + 通过 show-header属性,设置是否显示头部。默认值为:true
+ 通过title属性,设置窗口的标题。
+ `, + 'en-US': ` + Use the show-header property to set whether to display headers. The default value is true
+ Set the title of the window through the title property.
+ ` + }, + codeFiles: ['modal-header.vue'] }, { - demoId: 'message', + demoId: 'modal-footer', name: { - 'zh-CN': '自定义内容', - 'en-US': 'Custom Content' + 'zh-CN': '自定义弹窗底部', + 'en-US': 'Custom modal bottom' }, desc: { - 'zh-CN': '

可通过message属性设置窗口的内容。

', - 'en-US': '

You can set the content of the window through the :message attribute.

' - }, - codeFiles: ['message.vue'] + 'zh-CN': ` + 通过show-footer属性设置是否显示底部。默认值为:false
+ 通过confirm-content属性,修改确认按钮文字;cancel-content属性,修改取消按钮文字。
+ 通过confirm-btn-props属性,修改确认按钮的属性;cancel-btn-props属性,修改取消按钮的属性。
+ 通过footerDragable属性,让底部也支持拖动(默认只有标题栏可拖动)。默认值为:false
+ 通过#footer插槽,完全自定义底部内容。
+ `, + 'en-US': ` + Use the show-footer property to set whether the bottom is displayed. The default value is false
+ Modify the confirmation button text by using the confirm-content property; The cancer-content property modifies the cancel button text.
+ The confirm-btn-props property is used to modify the properties of the confirm button. cancer-btn-props property to modify the properties of the cancel button.
+ Use the footerDragable property to make the bottom also dragable (by default, only the title bar can be dragged). The default value is false
+ Completely customize the bottom content via the #footer slot.
+ ` + }, + codeFiles: ['modal-footer.vue'] }, + { - demoId: 'footer-btn-content', + demoId: 'modal-size', name: { - 'zh-CN': '自定义底部按钮内容', - 'en-US': 'Custom Bottom Button Content' + 'zh-CN': '弹窗大小/全屏', + 'en-US': 'Size control' }, desc: { - 'zh-CN': - '

可通过confirm-content属性设置确认按钮内容,cancel-content属性设置取消按钮内容。

\n', - 'en-US': - '

Set the content of the confirm button throughconfirm-content, and set the content of the cancel button through:cancel-content.

' - }, - codeFiles: ['footer-btn-content.vue'] + 'zh-CN': ` + 通过width属性,设置初始宽度,height属性设置初始高度,
+ 通过fullscreen属性,设置是否最大化显示。默认值为:false + `, + 'en-US': ` + Use the width property to set the width, and the height property to set the height,
+ Use the fullscreen property to set whether to maximize the display. + ` + }, + codeFiles: ['modal-size.vue'] }, { - demoId: 'footer-btn-props', + demoId: 'modal-resize', name: { - 'zh-CN': '自定义底部按钮', - 'en-US': 'Customize Bottom Button' + 'zh-CN': '弹窗调整大小', + 'en-US': 'Size control' }, desc: { - 'zh-CN': - '

可通过confirm-btn-props属性设置确认按钮,cancel-btn-props属性设置取消按钮。

\n', - 'en-US': - '

Set the confirmation button via :confirm-btn-props and the cancel button via :cancel-btn-props.

' - }, - codeFiles: ['footer-btn-props.vue'] + 'zh-CN': ` + 通过resize属性,设置是否允许拖动边框调整窗口大小,并且右上角显示切换最大化的按钮。
+ 当 resize属性设置为true后,通过 min-height属性设置拖拽后窗口的最小高度,默认值为 200.
+ min-width属性设置拖拽后窗口的最小宽度,默认值为 340。
+ `, + 'en-US': ` + With the resize property, set whether to allow dragging the border to resize the window, and the upper right corner shows a button to maximize the switch.
+ When the resize property is set to true, use the min-height property to set the minimum height of the drag-and-drop window. The default is 200.
+ The min-width property sets the minimum width of the drag-and-drop window. The default value is 340.
+ ` + }, + codeFiles: ['modal-resize.vue'] }, { - demoId: 'resize', + demoId: 'modal-mask', name: { - 'zh-CN': '调整窗口大小', - 'en-US': 'Resize The Window' + 'zh-CN': '弹窗的遮罩层', + 'en-US': 'Modal mask' }, desc: { - 'zh-CN': - '

可通过width属性设置宽度,height属性设置高度,resize属性设置是否允许拖动调整窗口大小。

', - 'en-US': - '

Use width to set the width, height to set the height, and resize to set whether to allow dragging to resize the window.

' - }, - codeFiles: ['resize.vue'] + 'zh-CN': ` + 通过mask属性,设置是否显示遮罩层。默认值为true
+ 通过mask-closable属性,设置是否允许点击遮罩层关闭窗口。默认值为false
+ `, + 'en-US': ` + The mask property can be used to set whether the mask layer is displayed. The default value is true
+ You can use the mask-closable property to set whether to allow clicking on the mask layer to close the window. The default value is false
+ ` + }, + codeFiles: ['modal-mask.vue'] }, { - demoId: 'min-width-height', + demoId: 'modal-lock', name: { - 'zh-CN': '调整窗口后的最小宽高度', - 'en-US': 'Minimum width and height after adjusting the window' + 'zh-CN': '弹窗的锁定', + 'en-US': 'Modal lock' }, desc: { - 'zh-CN': - '

可通过resize属性设置可拖拽属性为true后,min-height属性设置拖拽后窗口的最小高度,min-width属性设置拖拽后窗口的最小宽度。

', - 'en-US': - 'Theresizeproperty can be used to set the drag property totrue. Themin-heightproperty sets the minimum height of the window after dragging, and themin-widthproperty sets the minimum width of the window after dragging.' - }, - codeFiles: ['min-width-height.vue'] + 'zh-CN': ` + 通过lock-scroll属性,设置是否锁住滚动条,不允许页面滚动。默认值为false
+ 通过lock-view属性,设置是否锁住页面,不允许窗口之外的任何操作。默认值为true
+
+ 锁住滚动条 是指锁定body元素上的滚动条,仅当body有滚动条时,才有效果。
+ 锁住页面 是指鼠标不能操作蒙层下面的元素。
+
+ `, + 'en-US': ` + Use the lock-scroll property to set whether to lock the scroll bar to prevent page scrolling. The default value is false
+ Using the lock-view property, you can set whether to lock the page and not allow any operations outside the window. The default value is true
+
+ locks the scrollbar means to lock the scrollbar on the body element. This only works if the body has a scrollbar. + Locks the page means that the mouse cannot manipulate the elements below the mask.
+
+ ` + }, + codeFiles: ['modal-lock.vue'] }, + { - demoId: 'show-header-footer', + demoId: 'modal-other', name: { - 'zh-CN': '控制显示头部及底部', - 'en-US': 'Do Not Display Header and Bottom' + 'zh-CN': '弹窗的其它特性', + 'en-US': 'Other features of modal' }, desc: { - 'zh-CN': - '

可通过show-footer属性设置是否显示底部,show-header属性设置是否显示头部。

', - 'en-US': - 'Set whether to display the bottom through theshow-footerattribute, and whether to display the head through theshow-headerattribute.' - }, - codeFiles: ['show-header-footer.vue'] + 'zh-CN': ` + 通过esc-closable属性设置是否允许按 Esc 键关闭窗口。默认值为false
+ 通过z-index属性设置自定义堆叠顺序。
+ 通过is-form-reset属性,设置关闭弹窗后,是否重置数据。 默认值为true,即关闭弹窗后重置数据。
+ `, + 'en-US': ` + The esc-closable property sets whether to allow the Esc key to close the window. The default value is false
+ You can set a custom stack order using the z-index property.
+ You can use the is-form-reset property to set whether data is reset after modal is closed. The default value is true, that is, the data is reset after the modal window is closed.
+ ` + }, + codeFiles: ['modal-other.vue'] }, { - demoId: 'status', + demoId: 'modal-event', name: { - 'zh-CN': '消息状态', - 'en-US': 'Position From The Top' + 'zh-CN': '弹窗的事件', + 'en-US': 'Modal event' }, desc: { - 'zh-CN': - '

可通过status属性设置消息状态,可选值有infosuccesswarningerrorloading

', - 'en-US': - '

Set the message status throughstatus, with optional values includinginfosuccesswarningerrorloading.

' - }, - codeFiles: ['status.vue'] + 'zh-CN': ` + 当窗口显示时,会触发show事件
+ 当窗口关闭时,会触发hide事件
+ 当点击确定按钮时,会触发confirm事件
+ 当点击取消按钮时,会触发cancel事件
+ 当点击关闭按钮时,会触发close事件
+ 当窗口缩放时,会触发zoom事件
+
+ 1、type = 'alert' 时,没有cancel事件
+ 2、函数式调用时,不触发close事件
+
+ `, + 'en-US': ` + When the window is displayed, the show event
is triggered + When the window closes, the hide event
is triggered + When the OK button is clicked, the confirm event
is triggered. + When the cancel button is clicked, the cancel event
is triggered. + When the close button is clicked, the close event
is triggered. + When the window is scaled, the zoom event
is triggered. +
+ 1. When type = 'alert' , there is no cancel event
+ 2, function call, does not trigger close event
+
+ ` + }, + codeFiles: ['modal-event.vue'] }, { - demoId: 'message-closable', + demoId: 'modal-fn-slots', name: { - 'zh-CN': '关闭消息弹窗', - 'en-US': 'Close Message Pop-Up Window' + 'zh-CN': '弹窗的插槽', + 'en-US': 'Modal slots' }, desc: { - 'zh-CN': '

可通过message-closable属性设置消息可手动关闭。

', - 'en-US': '

Messages can be closed manually by setting message-closable.

' - }, - codeFiles: ['message-closable.vue'] + 'zh-CN': ` + 弹窗模式具有 #default , #footer 插槽,标签式时,使用标准的Vue插槽语法即可。
+ 在函数式使用时,通过slots属性,传入相应的插槽。 #footer 插槽的作用域上下文变量有: {$modal, beforeClose,confirm,cancel} 可使用。
+
+ 函数式传入插槽时,由于Modal组件是直接挂载到body上,不是在Demo组件内部渲染的,所以jsx引用组件时,要使用引用组件的变量,而不能使用Demo中注册的组件名。详见示例代码 +
+ `, + 'en-US': ` + modal mode has #default , #footer slots, and the standard Vue slot syntax can be used for tag mode.
+ When used functionally, you can pass in the corresponding slot via the slots attribute. < code > # footer < / code > slot context variables are: the scope of the < code > {$modal, beforeClose, confirm and cancel} < / code >.
+
+ When a function is passed into the slot, because the Modal component is mounted directly to the body instead of rendering inside the Demo component, when jsx references the component, the variable that references the component should be used. You cannot use the component name registered in Demo. See sample code +
+ modal mode has #default , #footer slots, and the standard Vue slot syntax can be used for tag mode.
+ When used functionally, you can pass in the corresponding slot via the slots attribute. < code > # footer < / code > slot context variables are: the scope of the < code > {$modal, beforeClose, confirm and cancel} < / code >.
+
+ When a function is passed into the slot, because the Modal component is mounted directly to the body instead of rendering inside the Demo component, when jsx references the component, the variable that references the component should be used. You cannot use the component name registered in Demo. See sample code +
+ ` + }, + codeFiles: ['modal-fn-slots.vue'] }, { - demoId: 'title', + demoId: 'message-close', name: { - 'zh-CN': '标题', - 'en-US': 'Title' + 'zh-CN': '消息的关闭和延时', + 'en-US': 'Closure and delay of messages' }, desc: { - 'zh-CN': '

可通过title属性设置窗口的标题。

', - 'en-US': '

Set the title of the window viatitle.

' - }, - codeFiles: ['title.vue'] + 'zh-CN': ` + 通过message-closable属性设置消息可手动关闭。默认值为false
+ 通过duration属性设置自动关闭的延迟时间,单位为毫秒。默认值为3000 ms
+ `, + 'en-US': ` + Messages can be manually closed by setting the message-closable property. The default value is false
+ The duration property is used to set the automatic shutdown delay in milliseconds. The default value is 3000 ms
+ ` + }, + codeFiles: ['message-close.vue'] }, { - demoId: 'top', + demoId: 'message-top', name: { - 'zh-CN': '距离顶部的位置', + 'zh-CN': '消息距离顶部位置', 'en-US': 'Position from top' }, desc: { - 'zh-CN': "

可通过top属性设置消息距离顶部的位置,仅当type='message'有效。

", - 'en-US': - "

Set the position of the message from the top via top, which is only valid when type='message'.

" - }, - codeFiles: ['top.vue'] - }, - { - demoId: 'type', - name: { - 'zh-CN': '窗口类型', - 'en-US': 'Custom Window Type' - }, - desc: { - 'zh-CN': '

可通过type属性设置窗口类型。

', - 'en-US': '

Set the window type via :type.

' - }, - codeFiles: ['type.vue'] - }, - { - demoId: 'value', - name: { - 'zh-CN': '绑定值', - 'en-US': 'Bind Value' - }, - desc: { - 'zh-CN': '

可通过modalValue/v-model属性设置绑定值,控制弹窗是否显示。

', - 'en-US': - '

Bind the value through modalValue/v-model to control whether the pop-up window is displayed.

' - }, - codeFiles: ['value.vue'] - }, - { - demoId: 'z-index', - name: { - 'zh-CN': '自定义堆叠顺序', - 'en-US': 'Custom Stacking Order' - }, - desc: { - 'zh-CN': '

可通过z-index属性设置自定义堆叠顺序。

', - 'en-US': '

Set a custom stacking order via z-index.

' - }, - codeFiles: ['z-index.vue'] - }, - { - demoId: 'is-form-reset', - name: { - 'zh-CN': '关闭弹窗,是否重置表单数据', - 'en-US': 'Do Not Reset Data After Closing Pop Ups' - }, - desc: { - 'zh-CN': '

可通过is-form-reset属性设置false,关闭弹窗后不重置数据。

', - 'en-US': - '

By setting theis-form-resetattribute tofalse, the data will not be reset after closing the pop-up window.

' - }, - codeFiles: ['is-form-reset.vue'] - }, - { - demoId: 'footer-slot', - name: { - 'zh-CN': '底部插槽', - 'en-US': 'Bottom Slot' - }, - desc: { - 'zh-CN': '

可通过#footer插槽设置底部内容。

', - 'en-US': '

The bottom content can be set through the #footer slot.' + 'zh-CN': '通过top属性设置消息距离顶部的位置,单位为px', + 'en-US': `Use the top property to set the distance from the top of the message in units of px. ` }, - codeFiles: ['footer-slot.vue'] + codeFiles: ['message-top.vue'] }, + { - demoId: 'default-grid', + demoId: 'message-id', name: { - 'zh-CN': '嵌套表格', - 'en-US': 'Nested Tables' - }, - desc: { - 'zh-CN': '

可通过#default插槽设置嵌套表格组件。

', - 'en-US': 'Table components can be nested via #default slot.' - }, - codeFiles: ['default-grid.vue'] - }, - { - demoId: 'event', - name: { - 'zh-CN': '事件', - 'en-US': 'event' + 'zh-CN': '防止重复消息提示', + 'en-US': 'Prevent Repeated Prompts' }, desc: { - 'zh-CN': - '

\n 当窗口显示时会触发show事件,关闭时会触发hide事件。
\n 当窗口缩放时会触发zoom事件。
\n 当点击确定按钮时会触发confirm事件,点击取消按钮时触发cancel事件。
\n 当点击关闭按钮时会触发close事件。
\n

', - 'en-US': '' + 'zh-CN': '通过id设置防止重复提示。', + 'en-US': 'Prevent repeated prompts with the id setting.' }, - codeFiles: ['event.vue'] + codeFiles: ['message-id.vue'] }, { - demoId: 'prop-slots', + demoId: 'message-event', name: { - 'zh-CN': '函数插槽', - 'en-US': 'When used functionally, the slot can be set through the `slots` property' + 'zh-CN': '消息的事件', + 'en-US': 'messeage event' }, desc: { - 'zh-CN': '

在函数式使用时,可通过slots属性设置插槽。

', - 'en-US': 'When used functionally, the slot can be set through the slots property.' - }, - codeFiles: ['prop-slots.vue'] + 'zh-CN': ` + 当窗口显示时,会触发show事件
+ 当窗口关闭时,会触发hide事件
+ `, + 'en-US': ` + When the window is displayed, the show event is triggered
+ When the window closes, the hide event is triggered
+ ` + }, + codeFiles: ['message-event.vue'] } ] } diff --git a/examples/sites/demos/pc/app/modal/z-index-composition-api.vue b/examples/sites/demos/pc/app/modal/z-index-composition-api.vue deleted file mode 100644 index b90bac4d6d..0000000000 --- a/examples/sites/demos/pc/app/modal/z-index-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/modal/z-index.spec.ts b/examples/sites/demos/pc/app/modal/z-index.spec.ts deleted file mode 100644 index b1c8857eae..0000000000 --- a/examples/sites/demos/pc/app/modal/z-index.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('自定义z-index', async ({ page }) => { - page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('modal#z-index') - - const modal = page.locator('.tiny-modal.active') - await page.getByRole('button', { name: /z-index/ }).click() - await expect(modal).toHaveCSS('z-index', '500') -}) diff --git a/examples/sites/demos/pc/app/modal/z-index.vue b/examples/sites/demos/pc/app/modal/z-index.vue deleted file mode 100644 index 102e7bc4b5..0000000000 --- a/examples/sites/demos/pc/app/modal/z-index.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/notify/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/notify/basic-usage-composition-api.vue index 4143d3aea2..f95257b018 100644 --- a/examples/sites/demos/pc/app/notify/basic-usage-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/basic-usage-composition-api.vue @@ -1,6 +1,7 @@ @@ -10,11 +11,24 @@ import { Notify, Button as TinyButton } from '@opentiny/vue' function handleClick() { Notify({ type: 'info', - title: (h, params) =>

通知消息的标题

, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 5000, customClass: 'my-custom-cls' }) } + +function handleClickJxs() { + Notify({ + type: 'info', + title: () =>

通知消息的标题

, + message: () => ( + 通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文 + ), + position: 'top-right', + duration: 5000, + customClass: 'my-custom-cls' + }) +} diff --git a/examples/sites/demos/pc/app/notify/basic-usage.spec.ts b/examples/sites/demos/pc/app/notify/basic-usage.spec.ts index 0a5cc39737..1958724326 100644 --- a/examples/sites/demos/pc/app/notify/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/notify/basic-usage.spec.ts @@ -3,10 +3,11 @@ import { test, expect } from '@playwright/test' test('基本用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('notify#basic-usage') - await page.getByRole('button', { name: '弹出提示框' }).click() + const status = page.locator('.tiny-notify__icon-status') + + await page.getByRole('button', { name: '弹出提示框' }).first().click() await expect(status).toBeVisible() - await expect(page.getByRole('heading', { name: '通知消息的标题' })).toBeVisible() await expect( page.getByText('通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文') ).toBeVisible() diff --git a/examples/sites/demos/pc/app/notify/basic-usage.vue b/examples/sites/demos/pc/app/notify/basic-usage.vue index 770985ae4c..e89b701d57 100644 --- a/examples/sites/demos/pc/app/notify/basic-usage.vue +++ b/examples/sites/demos/pc/app/notify/basic-usage.vue @@ -1,6 +1,7 @@ @@ -15,12 +16,24 @@ export default { handleClick() { Notify({ type: 'info', - title: (h, params) =>

通知消息的标题

, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 5000, customClass: 'my-custom-cls' }) + }, + handleClickJxs() { + Notify({ + type: 'info', + title: () =>

通知消息的标题

, + message: () => ( + 通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文 + ), + position: 'top-right', + duration: 5000, + customClass: 'my-custom-cls' + }) } } } diff --git a/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue b/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue index 58c37f2cbe..47487235db 100644 --- a/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue @@ -11,7 +11,7 @@ import { Notify, Button as TinyButton } from '@opentiny/vue' const handleClick = ref( Notify({ type: 'info', - title: (h, params) =>

通知消息的标题

, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 1000, diff --git a/examples/sites/demos/pc/app/notify/debounceDelay.vue b/examples/sites/demos/pc/app/notify/debounceDelay.vue index 733d28484a..2148a39f1c 100644 --- a/examples/sites/demos/pc/app/notify/debounceDelay.vue +++ b/examples/sites/demos/pc/app/notify/debounceDelay.vue @@ -15,7 +15,7 @@ export default { return { handleClick: Notify({ type: 'info', - title: (h, params) =>

通知消息的标题

, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 1000, diff --git a/examples/sites/demos/pc/app/notify/duration-composition-api.vue b/examples/sites/demos/pc/app/notify/duration-composition-api.vue index ee4382594d..868b4f28ec 100644 --- a/examples/sites/demos/pc/app/notify/duration-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/duration-composition-api.vue @@ -1,6 +1,5 @@ @@ -17,7 +17,7 @@ import { ref } from 'vue' import { Progress as TinyProgress, Button as TinyButton } from '@opentiny/vue' import { iconMinus, iconPlus } from '@opentiny/vue-icon' -const percentage = ref(90) +const percentage = ref(45) const IconMinus = iconMinus() const IconPlus = iconPlus() diff --git a/examples/sites/demos/pc/app/progress/basic-usage.spec.ts b/examples/sites/demos/pc/app/progress/basic-usage.spec.ts index 7ed4557082..fbfa18d5b3 100644 --- a/examples/sites/demos/pc/app/progress/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/progress/basic-usage.spec.ts @@ -12,18 +12,24 @@ test('基础用法,是否可动态控制进度条', async ({ page }) => { await expect(progress1).toBeVisible() await expect(progress2).toBeVisible() await expect(progress1).toHaveCSS('height', '4px') - await expect(progress2).toHaveCSS('height', '24px') + await expect(progress2).toHaveCSS('height', '12px') await expect(progress1).toHaveCSS('border-radius', '2px') - await expect(progress2).toHaveCSS('border-radius', '12px') - await expect(page.getByText('90%')).toHaveCount(2) + await expect(progress2).toHaveCSS('border-radius', '6px') + await expect(page.getByText('45%')).toHaveCount(2) await expect(page.getByText('努力加载中,请稍后...')).toBeVisible() - await expect(progress.nth(0)).toHaveAttribute('aria-valuenow', '90') - await expect(progress.nth(1)).toHaveAttribute('aria-valuenow', '90') + await expect(progress.nth(0)).toHaveAttribute('aria-valuenow', '45') + await expect(progress.nth(1)).toHaveAttribute('aria-valuenow', '45') + await demo.getByRole('button').nth(1).click() + await expect(progress.nth(0)).toHaveAttribute('aria-valuenow', '55') + await expect(progress.nth(1)).toHaveAttribute('aria-valuenow', '55') + await demo.getByRole('button').nth(1).click() + await demo.getByRole('button').nth(1).click() + await demo.getByRole('button').nth(1).click() + await demo.getByRole('button').nth(1).click() + await demo.getByRole('button').nth(1).click() await demo.getByRole('button').nth(1).click() await expect(page.getByText('努力加载中,请稍后...')).not.toBeVisible() - await expect(progress.nth(0)).toHaveAttribute('aria-valuenow', '100') - await expect(progress.nth(1)).toHaveAttribute('aria-valuenow', '100') await demo.getByRole('button').first().click() await expect(progress.nth(0)).toHaveAttribute('aria-valuenow', '90') await expect(progress.nth(1)).toHaveAttribute('aria-valuenow', '90') diff --git a/examples/sites/demos/pc/app/progress/basic-usage.vue b/examples/sites/demos/pc/app/progress/basic-usage.vue index 7efc845136..0e4ca84c5f 100644 --- a/examples/sites/demos/pc/app/progress/basic-usage.vue +++ b/examples/sites/demos/pc/app/progress/basic-usage.vue @@ -7,7 +7,7 @@

- +
努力加载中,请稍后...
@@ -23,7 +23,7 @@ export default { }, data() { return { - percentage: 90, + percentage: 45, IconMinus: iconMinus(), IconPlus: iconPlus() } diff --git a/examples/sites/demos/pc/app/progress/custom-color-composition-api.vue b/examples/sites/demos/pc/app/progress/custom-color-composition-api.vue index a9c6d4f053..b35cce88a3 100644 --- a/examples/sites/demos/pc/app/progress/custom-color-composition-api.vue +++ b/examples/sites/demos/pc/app/progress/custom-color-composition-api.vue @@ -1,11 +1,11 @@ @@ -14,11 +14,11 @@ import { ref } from 'vue' import { Progress as TinyProgress, Button as TinyButton } from '@opentiny/vue' const value = ref(20) -const customColor = ref('#409eff') +const customColor = ref('#5cb300') // 在什么进度显示什么样的颜色 const customColors = ref([ { color: '#f56c6c', percentage: 20 }, - { color: '#e6a23c', percentage: 40 }, + { color: '#ff8800', percentage: 40 }, { color: '#5cb87a', percentage: 60 }, { color: '#1989fa', percentage: 80 }, { color: '#6f7ad3', percentage: 100 } @@ -34,7 +34,7 @@ function add() { // 在什么进度显示什么样的颜色 function customColorMethod(percentage) { if (percentage < 30) { - return '#909399' + return '#f23030' } else if (percentage < 70) { return '#e6a23c' } else { @@ -42,3 +42,9 @@ function customColorMethod(percentage) { } } + + diff --git a/examples/sites/demos/pc/app/progress/custom-color.spec.ts b/examples/sites/demos/pc/app/progress/custom-color.spec.ts index 4ad023f676..550b2621fa 100644 --- a/examples/sites/demos/pc/app/progress/custom-color.spec.ts +++ b/examples/sites/demos/pc/app/progress/custom-color.spec.ts @@ -10,23 +10,23 @@ test('根据长度改变颜色', async ({ page }) => { const progress3 = progress.nth(2).locator('div.tiny-progress-bar__inner') const button = page.getByRole('button', { name: '点击增加改变颜色' }) - await expect(progress1).toHaveCSS('background-color', 'rgb(64, 158, 255)') - await expect(progress2).toHaveCSS('background-color', 'rgb(144, 147, 153)') - await expect(progress3).toHaveCSS('background-color', 'rgb(230, 162, 60)') + await expect(progress1).toHaveCSS('background-color', 'rgb(92, 179, 0)') + await expect(progress2).toHaveCSS('background-color', 'rgb(242, 48, 48)') + await expect(progress3).toHaveCSS('background-color', 'rgb(255, 136, 0)') await button.click() - await expect(progress1).toHaveCSS('background-color', 'rgb(64, 158, 255)') + await expect(progress1).toHaveCSS('background-color', 'rgb(92, 179, 0)') await expect(progress2).toHaveCSS('background-color', 'rgb(230, 162, 60)') await expect(progress3).toHaveCSS('background-color', 'rgb(92, 184, 122)') await button.click() - await expect(progress1).toHaveCSS('background-color', 'rgb(64, 158, 255)') + await expect(progress1).toHaveCSS('background-color', 'rgb(92, 179, 0)') await expect(progress2).toHaveCSS('background-color', 'rgb(230, 162, 60)') await expect(progress3).toHaveCSS('background-color', 'rgb(25, 137, 250)') await button.click() - await expect(progress1).toHaveCSS('background-color', 'rgb(64, 158, 255)') + await expect(progress1).toHaveCSS('background-color', 'rgb(92, 179, 0)') await expect(progress2).toHaveCSS('background-color', 'rgb(103, 194, 58)') await expect(progress3).toHaveCSS('background-color', 'rgb(111, 122, 211)') await button.click() - await expect(progress1).toHaveCSS('background-color', 'rgb(64, 158, 255)') + await expect(progress1).toHaveCSS('background-color', 'rgb(92, 179, 0)') await expect(progress2).toHaveCSS('background-color', 'rgb(103, 194, 58)') await expect(progress3).toHaveCSS('background-color', 'rgb(111, 122, 211)') }) diff --git a/examples/sites/demos/pc/app/progress/custom-color.vue b/examples/sites/demos/pc/app/progress/custom-color.vue index 7175563d85..4463a4e102 100644 --- a/examples/sites/demos/pc/app/progress/custom-color.vue +++ b/examples/sites/demos/pc/app/progress/custom-color.vue @@ -1,11 +1,11 @@ @@ -20,11 +20,11 @@ export default { data() { return { value: 20, - customColor: '#409eff', + customColor: '#5cb300', // 在什么进度显示什么样的颜色 customColors: [ { color: '#f56c6c', percentage: 20 }, - { color: '#e6a23c', percentage: 40 }, + { color: '#ff8800', percentage: 40 }, { color: '#5cb87a', percentage: 60 }, { color: '#1989fa', percentage: 80 }, { color: '#6f7ad3', percentage: 100 } @@ -41,7 +41,7 @@ export default { // 在什么进度显示什么样的颜色 customColorMethod(percentage) { if (percentage < 30) { - return '#909399' + return '#f23030' } else if (percentage < 70) { return '#e6a23c' } else { @@ -51,3 +51,9 @@ export default { } } + + diff --git a/examples/sites/demos/pc/app/progress/custom-status-composition-api.vue b/examples/sites/demos/pc/app/progress/custom-status-composition-api.vue index 673dcbd87d..c8d77f8b62 100644 --- a/examples/sites/demos/pc/app/progress/custom-status-composition-api.vue +++ b/examples/sites/demos/pc/app/progress/custom-status-composition-api.vue @@ -12,7 +12,7 @@ type="line" :percentage="percentage" status="exception" - :stroke-width="24" + :stroke-width="12" >
@@ -32,7 +32,7 @@
取消
- + @@ -49,7 +49,7 @@ type="line" :percentage="percentage2" status="exception" - :stroke-width="24" + :stroke-width="12" >
@@ -73,7 +73,7 @@ type="line" :percentage="percentage3" status="success" - :stroke-width="24" + :stroke-width="12" >
@@ -143,6 +143,9 @@ onMounted(() => { diff --git a/examples/sites/demos/pc/app/progress/format-text.spec.ts b/examples/sites/demos/pc/app/progress/format-text.spec.ts index 37d879ec28..88fc01187e 100644 --- a/examples/sites/demos/pc/app/progress/format-text.spec.ts +++ b/examples/sites/demos/pc/app/progress/format-text.spec.ts @@ -10,13 +10,14 @@ test('文字的显隐和位置', async ({ page }) => { const button1 = page.getByRole('button', { name: '外置文字' }) const button2 = page.getByRole('button', { name: '内置文字' }) + await button2.click() await expect(innerText).toBeVisible() await button1.click() await expect(outerText).toBeVisible() await button2.click() await expect(innerText).toBeVisible() - const text = page.getByText('自定义文字内容 60%') + const text = page.getByText('自定义文字内容 45%') await expect(text).toBeVisible() await page.getByRole('button', { name: '隐藏文字' }).click() diff --git a/examples/sites/demos/pc/app/progress/format-text.vue b/examples/sites/demos/pc/app/progress/format-text.vue index 0daa9377cd..72856c9c3b 100644 --- a/examples/sites/demos/pc/app/progress/format-text.vue +++ b/examples/sites/demos/pc/app/progress/format-text.vue @@ -9,7 +9,7 @@ diff --git a/examples/sites/demos/pc/app/progress/progress-status-composition-api.vue b/examples/sites/demos/pc/app/progress/progress-status-composition-api.vue index 93548c8295..cfea50a5fa 100644 --- a/examples/sites/demos/pc/app/progress/progress-status-composition-api.vue +++ b/examples/sites/demos/pc/app/progress/progress-status-composition-api.vue @@ -9,7 +9,7 @@ @@ -17,7 +17,7 @@ @@ -25,7 +25,7 @@ diff --git a/examples/sites/demos/pc/app/progress/progress-status.spec.ts b/examples/sites/demos/pc/app/progress/progress-status.spec.ts index eff63b0b4d..7e24c60ca4 100644 --- a/examples/sites/demos/pc/app/progress/progress-status.spec.ts +++ b/examples/sites/demos/pc/app/progress/progress-status.spec.ts @@ -14,8 +14,8 @@ test('三种状态是否正常显示', async ({ page }) => { await expect(icons).toHaveCount(3) for (let i = 0; i < 3; i++) { const { width, height } = await icons.nth(i).boundingBox() - await expect(width).toBeGreaterThanOrEqual(20) - await expect(height).toBeGreaterThanOrEqual(20) + await expect(width).toBeGreaterThanOrEqual(16) + await expect(height).toBeGreaterThanOrEqual(16) } await button.click() await expect(success).toHaveAttribute('aria-valuenow', '100') diff --git a/examples/sites/demos/pc/app/progress/progress-status.vue b/examples/sites/demos/pc/app/progress/progress-status.vue index 4e6cc4f18e..76d886dd2f 100644 --- a/examples/sites/demos/pc/app/progress/progress-status.vue +++ b/examples/sites/demos/pc/app/progress/progress-status.vue @@ -9,7 +9,7 @@ @@ -17,7 +17,7 @@ @@ -25,7 +25,7 @@ diff --git a/examples/sites/demos/pc/app/progress/progress-type-circle-composition-api.vue b/examples/sites/demos/pc/app/progress/progress-type-circle-composition-api.vue index 4d9abebf3b..46e4af6e1d 100644 --- a/examples/sites/demos/pc/app/progress/progress-type-circle-composition-api.vue +++ b/examples/sites/demos/pc/app/progress/progress-type-circle-composition-api.vue @@ -1,14 +1,14 @@ diff --git a/examples/sites/demos/pc/app/tag-group/more.vue b/examples/sites/demos/pc/app/tag-group/more.vue new file mode 100644 index 0000000000..0c92292867 --- /dev/null +++ b/examples/sites/demos/pc/app/tag-group/more.vue @@ -0,0 +1,90 @@ + + + diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-effect-composition-api.vue b/examples/sites/demos/pc/app/tag-group/tag-group-effect-composition-api.vue index 4eb49667a7..f29cbeff6b 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-effect-composition-api.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-effect-composition-api.vue @@ -1,10 +1,10 @@ @@ -18,8 +18,7 @@ const items = ref([ { type: 'info', name: '标签二' }, { type: 'success', name: '标签三' }, { type: 'warning', name: '标签四' }, - { type: 'danger', name: '标签五' }, - { name: '标签六' } + { type: 'danger', name: '标签五' } ]) @@ -27,4 +26,4 @@ const items = ref([ .tiny-demo-tag-group-effect > *:not(:last-child) { margin-bottom: 12px; } - \ No newline at end of file + diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-effect.spec.js b/examples/sites/demos/pc/app/tag-group/tag-group-effect.spec.js index 0e455b4ef4..98adb39233 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-effect.spec.js +++ b/examples/sites/demos/pc/app/tag-group/tag-group-effect.spec.js @@ -6,66 +6,66 @@ test('TagGroup 主题', async ({ page }) => { const tagGroupsLocator = page.locator('.tiny-demo-tag-group-effect .tiny-tag-group') + // 深色 const darkTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--dark').filter({ hasText: '标签一' }) - await expect(darkTag1).toHaveCSS('background-color', 'rgb(94, 124, 224)') + await expect(darkTag1).toHaveCSS('background-color', 'rgb(25, 25, 25)') await expect(darkTag1).toHaveCSS('color', 'rgb(255, 255, 255)') const darkTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--dark').filter({ hasText: '标签二' }) - await expect(darkTag2).toHaveCSS('background-color', 'rgb(37, 43, 58)') + await expect(darkTag2).toHaveCSS('background-color', 'rgb(20, 118, 255)') await expect(darkTag2).toHaveCSS('color', 'rgb(255, 255, 255)') const darkTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--dark').filter({ hasText: '标签三' }) - await expect(darkTag3).toHaveCSS('background-color', 'rgb(80, 212, 171)') + await expect(darkTag3).toHaveCSS('background-color', 'rgb(92, 179, 0)') await expect(darkTag3).toHaveCSS('color', 'rgb(255, 255, 255)') const darkTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--dark').filter({ hasText: '标签四' }) - await expect(darkTag4).toHaveCSS('background-color', 'rgb(250, 152, 65)') + await expect(darkTag4).toHaveCSS('background-color', 'rgb(255, 136, 0)') await expect(darkTag4).toHaveCSS('color', 'rgb(255, 255, 255)') const darkTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--dark').filter({ hasText: '标签五' }) - await expect(darkTag5).toHaveCSS('background-color', 'rgb(246, 111, 106)') + await expect(darkTag5).toHaveCSS('background-color', 'rgb(242, 48, 48)') await expect(darkTag5).toHaveCSS('color', 'rgb(255, 255, 255)') - + // 浅色 const lightTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签一' }) - await expect(lightTag1).toHaveCSS('background-color', 'rgb(238, 240, 245)') - await expect(lightTag1).toHaveCSS('color', 'rgb(87, 93, 108)') + await expect(lightTag1).toHaveCSS('background-color', 'rgb(245, 245, 245)') + await expect(lightTag1).toHaveCSS('color', 'rgb(25, 25, 25)') const lightTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签二' }) - await expect(lightTag2).toHaveCSS('background-color', 'rgba(51, 51, 51, 0.06)') - await expect(lightTag2).toHaveCSS('color', 'rgb(37, 43, 58)') + await expect(lightTag2).toHaveCSS('background-color', 'rgb(222, 236, 255)') + await expect(lightTag2).toHaveCSS('color', 'rgb(20, 118, 255)') const lightTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签三' }) - await expect(lightTag3).toHaveCSS('background-color', 'rgb(237, 255, 249)') - await expect(lightTag3).toHaveCSS('color', 'rgb(58, 194, 149)') + await expect(lightTag3).toHaveCSS('background-color', 'rgb(230, 242, 213)') + await expect(lightTag3).toHaveCSS('color', 'rgb(92, 179, 0)') const lightTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签四' }) - await expect(lightTag4).toHaveCSS('background-color', 'rgb(255, 243, 232)') - await expect(lightTag4).toHaveCSS('color', 'rgb(227, 125, 41)') + await expect(lightTag4).toHaveCSS('background-color', 'rgb(255, 235, 209)') + await expect(lightTag4).toHaveCSS('color', 'rgb(255, 136, 0)') const lightTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签五' }) - await expect(lightTag5).toHaveCSS('background-color', 'rgb(255, 238, 237)') - await expect(lightTag5).toHaveCSS('color', 'rgb(222, 80, 78)') - + await expect(lightTag5).toHaveCSS('background-color', 'rgb(252, 227, 225)') + await expect(lightTag5).toHaveCSS('color', 'rgb(242, 48, 48)') + // plain const plainTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签一' }) await expect(plainTag1).toHaveCSS('background-color', 'rgb(255, 255, 255)') - await expect(plainTag1).toHaveCSS('color', 'rgb(94, 124, 224)') + await expect(plainTag1).toHaveCSS('color', 'rgb(25, 25, 25)') const plainTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签二' }) await expect(plainTag2).toHaveCSS('background-color', 'rgb(255, 255, 255)') - await expect(plainTag2).toHaveCSS('color', 'rgb(37, 43, 58)') + await expect(plainTag2).toHaveCSS('color', 'rgb(20, 118, 255)') const plainTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签三' }) await expect(plainTag3).toHaveCSS('background-color', 'rgb(255, 255, 255)') - await expect(plainTag3).toHaveCSS('color', 'rgb(80, 212, 171)') + await expect(plainTag3).toHaveCSS('color', 'rgb(92, 179, 0)') const plainTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签四' }) await expect(plainTag4).toHaveCSS('background-color', 'rgb(255, 255, 255)') - await expect(plainTag4).toHaveCSS('color', 'rgb(250, 152, 65)') + await expect(plainTag4).toHaveCSS('color', 'rgb(255, 136, 0)') const plainTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签五' }) await expect(plainTag5).toHaveCSS('background-color', 'rgb(255, 255, 255)') - await expect(plainTag5).toHaveCSS('color', 'rgb(246, 111, 106)') - + await expect(plainTag5).toHaveCSS('color', 'rgb(242, 48, 48)') }) diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-effect.vue b/examples/sites/demos/pc/app/tag-group/tag-group-effect.vue index 34a46f392e..e49262f8fb 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-effect.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-effect.vue @@ -1,10 +1,10 @@ @@ -23,8 +23,7 @@ export default { { type: 'info', name: '标签二' }, { type: 'success', name: '标签三' }, { type: 'warning', name: '标签四' }, - { type: 'danger', name: '标签五' }, - { name: '标签六' } + { type: 'danger', name: '标签五' } ] } } @@ -35,4 +34,4 @@ export default { .tiny-demo-tag-group-effect > *:not(:last-child) { margin-bottom: 12px; } - \ No newline at end of file + diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-event-composition-api.vue b/examples/sites/demos/pc/app/tag-group/tag-group-event-composition-api.vue index 7f52012400..e3bf7a81f2 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-event-composition-api.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-event-composition-api.vue @@ -12,66 +12,6 @@ const data = ref([ }, { name: '标签二' - }, - { - name: '标签三' - }, - { - name: '标签四' - }, - { - name: '标签五' - }, - { - name: '标签六' - }, - { - name: '标签七' - }, - { - name: '标签八' - }, - { - name: '标签九' - }, - { - name: '标签十' - }, - { - name: '标签十一' - }, - { - name: '标签十二' - }, - { - name: '标签十三' - }, - { - name: '标签十四' - }, - { - name: '标签十五' - }, - { - name: '标签十六' - }, - { - name: '标签十七' - }, - { - name: '标签十八' - }, - { - name: '标签十九' - }, - { - name: '标签二十' - }, - { - name: '标签二十一' - }, - { - name: '标签二十二' } ]) diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-event.spec.js b/examples/sites/demos/pc/app/tag-group/tag-group-event.spec.js index ac42c1a36b..b7f8bc3f08 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-event.spec.js +++ b/examples/sites/demos/pc/app/tag-group/tag-group-event.spec.js @@ -4,8 +4,8 @@ test('TagGroup 事件', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('tag-group#tag-group-event') - const tag3 = page.locator('.tiny-tag ').filter({ hasText: '标签三' }) + const tag3 = page.locator('.tiny-tag ').filter({ hasText: '标签二' }) await tag3.click() - await expect(page.locator('.tiny-modal__box').filter({ hasText: '当前点击的是第3个标签' })).toBeVisible() + await expect(page.locator('.tiny-modal__box').filter({ hasText: '当前点击的是第2个标签' })).toBeVisible() }) diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-event.vue b/examples/sites/demos/pc/app/tag-group/tag-group-event.vue index 0c92292867..d95e4dc674 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-event.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-event.vue @@ -17,66 +17,6 @@ export default { }, { name: '标签二' - }, - { - name: '标签三' - }, - { - name: '标签四' - }, - { - name: '标签五' - }, - { - name: '标签六' - }, - { - name: '标签七' - }, - { - name: '标签八' - }, - { - name: '标签九' - }, - { - name: '标签十' - }, - { - name: '标签十一' - }, - { - name: '标签十二' - }, - { - name: '标签十三' - }, - { - name: '标签十四' - }, - { - name: '标签十五' - }, - { - name: '标签十六' - }, - { - name: '标签十七' - }, - { - name: '标签十八' - }, - { - name: '标签十九' - }, - { - name: '标签二十' - }, - { - name: '标签二十一' - }, - { - name: '标签二十二' } ] } diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-size-composition-api.vue b/examples/sites/demos/pc/app/tag-group/tag-group-size-composition-api.vue index 03ddbe9250..0adc890855 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-size-composition-api.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-size-composition-api.vue @@ -1,10 +1,10 @@ @@ -27,4 +27,4 @@ const items = ref([ .tiny-demo-tag-group-size > *:not(:last-child) { margin-bottom: 12px; } - \ No newline at end of file + diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-size.spec.js b/examples/sites/demos/pc/app/tag-group/tag-group-size.spec.js index f4a26f6fdc..4b8056536c 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-size.spec.js +++ b/examples/sites/demos/pc/app/tag-group/tag-group-size.spec.js @@ -5,16 +5,14 @@ test('TagGroup 尺寸', async ({ page }) => { await page.goto('tag-group#tag-group-size') const mediumTag = page.locator('.tiny-demo-tag-group-size .tiny-tag-group .tiny-tag.tiny-tag--medium').nth(0) - await expect(mediumTag).toHaveCSS('height', '24px') - await expect(mediumTag).toHaveCSS('line-height', '24px') - + await expect(mediumTag).toHaveCSS('height', '32px') + await expect(mediumTag).toHaveCSS('line-height', '21px') const smallTag = page.locator('.tiny-demo-tag-group-size .tiny-tag-group .tiny-tag.tiny-tag--small').nth(0) await expect(smallTag).toHaveCSS('height', '20px') - await expect(smallTag).toHaveCSS('line-height', '20px') + await expect(smallTag).toHaveCSS('line-height', '18px') const miniTag = page.locator('.tiny-demo-tag-group-size .tiny-tag-group .tiny-tag.tiny-tag--mini').nth(0) - await expect(miniTag).toHaveCSS('height', '16px') - await expect(miniTag).toHaveCSS('line-height', '16px') - + await expect(miniTag).toHaveCSS('height', '18px') + await expect(miniTag).toHaveCSS('line-height', '15px') }) diff --git a/examples/sites/demos/pc/app/tag-group/tag-group-size.vue b/examples/sites/demos/pc/app/tag-group/tag-group-size.vue index 2f5b329deb..2c7b5de79d 100644 --- a/examples/sites/demos/pc/app/tag-group/tag-group-size.vue +++ b/examples/sites/demos/pc/app/tag-group/tag-group-size.vue @@ -1,10 +1,10 @@ @@ -35,4 +35,4 @@ export default { .tiny-demo-tag-group-size > *:not(:last-child) { margin-bottom: 12px; } - \ No newline at end of file + diff --git a/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js b/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js index 6e66cf195c..9a62ab1f97 100644 --- a/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js +++ b/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js @@ -8,13 +8,32 @@ export default { 'zh-CN': '基本用法', 'en-US': 'basic usage' }, + desc: { + 'zh-CN': `通过 data 属性设置标签组的数组数据。
+ 每一项标签数据,可以通过标签数据的name 属性设置对应标签名;
+ 通过标签数据的 type 属性可以为标签设置相应的类型,可选值 (success / warning / info / danger )
+ `, + 'en-US': ` + Set the array data of the tag group with the data property.
+ For each item of label data, you can set the corresponding label name through the name attribute of the label data.
+ The type attribute of the tag data can set the corresponding type for the tag. The optional value is (success/warning/info/danger).
+ ` + }, + codeFiles: ['basic-usage.vue'] + }, + { + demoId: 'tag-group-effect', + name: { + 'zh-CN': '主题', + 'en-US': 'effect' + }, desc: { 'zh-CN': - '

通过 name 属性设置对应标签名。
通过 type 属性可以为标签设置相应的类型,可选值 (success / warning / info / danger )

', + '

可通过 effect 设置 TagGroup 标签组 标签主题,可选值 dark / light / plain,默认值为 light

', 'en-US': - 'Set the name of the corresponding tag through the name attribute.
You can set the type of a tag through the type attribute. The value can be (success / warning / info / danger). info. ' + 'You can use effect to set the tag group tag theme. The options are dark / light / plain. The default value is light. ' }, - codeFiles: ['basic-usage.vue'] + codeFiles: ['tag-group-effect.vue'] }, { demoId: 'tag-group-size', @@ -31,24 +50,23 @@ export default { codeFiles: ['tag-group-size.vue'] }, { - demoId: 'tag-group-effect', + demoId: 'more', name: { - 'zh-CN': '主题', - 'en-US': 'effect' + 'zh-CN': '显示更多', + 'en-US': 'More' }, desc: { - 'zh-CN': - '

可通过 effect 设置 TagGroup 标签组 标签主题,可选值 dark / light / plain,默认值为 light

', + 'zh-CN': '标签组会自动识别子项的长度,当子项超出一行显示时,未尾自动显示更多的图标,鼠标悬浮会提示剩余子项。', 'en-US': - 'You can use effect to set the tag group tag theme. The options are dark / light / plain. The default value is light. ' + 'The label group automatically identifies the length of the subitem. When the subitem is displayed in more than one row, more ICONS are displayed automatically. The mouse hover displays the remaining subitems' }, - codeFiles: ['tag-group-effect.vue'] + codeFiles: ['more.vue'] }, { demoId: 'tag-group-event', name: { - 'zh-CN': 'Click 事件', - 'en-US': 'click event' + 'zh-CN': '事件', + 'en-US': 'event' }, desc: { 'zh-CN': diff --git a/examples/sites/demos/pc/app/tag/size-composition-api.vue b/examples/sites/demos/pc/app/tag/size-composition-api.vue index a0f8bf245f..575cd2ff85 100644 --- a/examples/sites/demos/pc/app/tag/size-composition-api.vue +++ b/examples/sites/demos/pc/app/tag/size-composition-api.vue @@ -1,9 +1,9 @@ diff --git a/examples/sites/demos/pc/app/tag/size.vue b/examples/sites/demos/pc/app/tag/size.vue index f623709e14..ecb5eb0419 100644 --- a/examples/sites/demos/pc/app/tag/size.vue +++ b/examples/sites/demos/pc/app/tag/size.vue @@ -1,9 +1,9 @@ diff --git a/examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue index 295499adcd..d732580363 100644 --- a/examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue +++ b/examples/sites/demos/pc/app/tree-menu/basic-usage-composition-api.vue @@ -1,5 +1,5 @@ diff --git a/examples/sites/demos/pc/app/tree-menu/default-expand-all.vue b/examples/sites/demos/pc/app/tree-menu/default-expand-all.vue index 460dad9ae6..3a82b52c85 100644 --- a/examples/sites/demos/pc/app/tree-menu/default-expand-all.vue +++ b/examples/sites/demos/pc/app/tree-menu/default-expand-all.vue @@ -1,5 +1,6 @@