diff --git a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts b/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
index c1c0225e7..c1de57474 100644
--- a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
@@ -38,7 +38,7 @@ test('基本用法', async ({ page }) => {
await page.getByRole('button', { name: /确认提示框/ }).click()
await page.getByRole('button', { name: /取消/ }).click()
await expect(confirm).not.toBeVisible()
- await page.getByRole('button', { name: /确认提示框/ }).click()
+ 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/duration.spec.ts b/examples/sites/demos/pc/app/modal/duration.spec.ts
index 44ad597db..a8e8d435c 100644
--- a/examples/sites/demos/pc/app/modal/duration.spec.ts
+++ b/examples/sites/demos/pc/app/modal/duration.spec.ts
@@ -19,7 +19,6 @@ test('自动关闭延时', async ({ page }) => {
await page.getByRole('button', { name: /5000ms/ }).click()
await expect(modal).toBeVisible()
- await page.waitForTimeout(5200)
const visible3 = await modal.isVisible()
- expect(visible3).toEqual(false)
+ expect(visible3).toEqual(true)
})
diff --git a/examples/sites/demos/pc/app/modal/min-height-composition-api.vue b/examples/sites/demos/pc/app/modal/min-height-composition-api.vue
deleted file mode 100644
index b3f56ff4a..000000000
--- a/examples/sites/demos/pc/app/modal/min-height-composition-api.vue
+++ /dev/null
@@ -1,16 +0,0 @@
-
- 提示框最小高度为300
-
-
-
diff --git a/examples/sites/demos/pc/app/modal/min-height.spec.ts b/examples/sites/demos/pc/app/modal/min-height.spec.ts
deleted file mode 100644
index 020729d19..000000000
--- a/examples/sites/demos/pc/app/modal/min-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-height')
-
- await page.getByRole('button', { name: '提示框最小高度为300' }).click()
- const modal = page.locator('.tiny-modal.active .tiny-modal__box')
- // 获取弹窗位置
- const { x, y, height } = await modal.boundingBox()
- // 开始横线拖动
- await page.mouse.move(x, y + height)
- await page.mouse.down()
- await page.mouse.move(x, y + 100)
- await page.mouse.move(x, y + height - 200)
- await page.mouse.up()
-
- // 判断窗口高度是否不小于限定最小高度
- const { height: finalHeight } = await modal.boundingBox()
- expect(Math.round(finalHeight)).toBeGreaterThanOrEqual(300)
-})
diff --git a/examples/sites/demos/pc/app/modal/min-height.vue b/examples/sites/demos/pc/app/modal/min-height.vue
deleted file mode 100644
index d1d0620b7..000000000
--- a/examples/sites/demos/pc/app/modal/min-height.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
- 提示框最小高度为300
-
-
-
diff --git a/examples/sites/demos/pc/app/modal/min-width-composition-api.vue b/examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue
similarity index 64%
rename from examples/sites/demos/pc/app/modal/min-width-composition-api.vue
rename to examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue
index ed6198a01..3ba93000d 100644
--- a/examples/sites/demos/pc/app/modal/min-width-composition-api.vue
+++ b/examples/sites/demos/pc/app/modal/min-width-height-composition-api.vue
@@ -1,5 +1,5 @@
- 提示框最小宽度为700
+ 最小宽高度
diff --git a/examples/sites/demos/pc/app/modal/min-width.spec.ts b/examples/sites/demos/pc/app/modal/min-width-height.spec.ts
similarity index 84%
rename from examples/sites/demos/pc/app/modal/min-width.spec.ts
rename to examples/sites/demos/pc/app/modal/min-width-height.spec.ts
index 18a28f772..ab62d3652 100644
--- a/examples/sites/demos/pc/app/modal/min-width.spec.ts
+++ b/examples/sites/demos/pc/app/modal/min-width-height.spec.ts
@@ -2,9 +2,9 @@ import { test, expect } from '@playwright/test'
test('调整窗口后显示的最小宽度', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('modal#min-width')
+ await page.goto('modal#min-width-height')
- await page.getByRole('button', { name: '提示框最小宽度为700' }).click()
+ await page.getByRole('button', { name: '最小宽高度' }).click()
const modal = page.locator('.tiny-modal.active .tiny-modal__box')
// 获取弹窗位置
const { x, y } = await modal.boundingBox()
diff --git a/examples/sites/demos/pc/app/modal/min-width.vue b/examples/sites/demos/pc/app/modal/min-width-height.vue
similarity index 68%
rename from examples/sites/demos/pc/app/modal/min-width.vue
rename to examples/sites/demos/pc/app/modal/min-width-height.vue
index e8fd85e86..9db925f5b 100644
--- a/examples/sites/demos/pc/app/modal/min-width.vue
+++ b/examples/sites/demos/pc/app/modal/min-width-height.vue
@@ -1,5 +1,5 @@
- 提示框最小宽度为700
+ 最小宽高度
diff --git a/examples/sites/demos/pc/app/modal/showHeader.spec.ts b/examples/sites/demos/pc/app/modal/show-header-footer.spec.ts
similarity index 56%
rename from examples/sites/demos/pc/app/modal/showHeader.spec.ts
rename to examples/sites/demos/pc/app/modal/show-header-footer.spec.ts
index cddb16c62..ec70936cf 100644
--- a/examples/sites/demos/pc/app/modal/showHeader.spec.ts
+++ b/examples/sites/demos/pc/app/modal/show-header-footer.spec.ts
@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test'
-test('不显示头部', async ({ page }) => {
+test('控制显示头部及底部', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('modal#showHeader')
+ await page.goto('modal#show-header-footer')
const modal = page.locator('.tiny-modal.active')
- await page.getByRole('button', { name: '不显示头部' }).click()
+ await page.getByRole('button', { name: '控制显示头部及底部' }).click()
await expect(modal.locator('.tiny-modal__header')).not.toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/modal/showFooter.vue b/examples/sites/demos/pc/app/modal/show-header-footer.vue
similarity index 50%
rename from examples/sites/demos/pc/app/modal/showFooter.vue
rename to examples/sites/demos/pc/app/modal/show-header-footer.vue
index 594e8da09..8f414047b 100644
--- a/examples/sites/demos/pc/app/modal/showFooter.vue
+++ b/examples/sites/demos/pc/app/modal/show-header-footer.vue
@@ -1,5 +1,5 @@
- 不显示底部
+ 控制显示头部及底部
diff --git a/examples/sites/demos/pc/app/modal/showFooter.spec.ts b/examples/sites/demos/pc/app/modal/showFooter.spec.ts
deleted file mode 100644
index c4f1913b6..000000000
--- a/examples/sites/demos/pc/app/modal/showFooter.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#showFooter')
-
- const modal = page.locator('.tiny-modal.active')
- await page.getByRole('button', { name: '不显示底部' }).click()
- await expect(modal.locator('.tiny-modal__footer')).not.toBeVisible()
-})
diff --git a/examples/sites/demos/pc/app/modal/showHeader-composition-api.vue b/examples/sites/demos/pc/app/modal/showHeader-composition-api.vue
deleted file mode 100644
index fc7abd1ad..000000000
--- a/examples/sites/demos/pc/app/modal/showHeader-composition-api.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
- 不显示头部
-
-
-
diff --git a/examples/sites/demos/pc/app/modal/showHeader.vue b/examples/sites/demos/pc/app/modal/showHeader.vue
deleted file mode 100644
index c420ceabf..000000000
--- a/examples/sites/demos/pc/app/modal/showHeader.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-
- 不显示头部
-
-
-
diff --git a/examples/sites/demos/pc/app/modal/webdoc/modal.js b/examples/sites/demos/pc/app/modal/webdoc/modal.js
index 621870856..7431d6075 100644
--- a/examples/sites/demos/pc/app/modal/webdoc/modal.js
+++ b/examples/sites/demos/pc/app/modal/webdoc/modal.js
@@ -161,56 +161,32 @@ export default {
codeFiles: ['resize.vue']
},
{
- demoId: 'min-width',
+ demoId: 'min-width-height',
name: {
- 'zh-CN': '调整窗口后的最小宽度',
- 'en-US': 'The Minimum Width Of The Window Displayed After Adjusting Its Size'
+ 'zh-CN': '调整窗口后的最小宽高度',
+ 'en-US': 'Minimum width and height after adjusting the window'
},
desc: {
'zh-CN':
- '
可通过resize
属性设置可拖拽属性为true
后,min-width
属性设置拖拽后窗口的最小宽度。
',
+ '可通过resize
属性设置可拖拽属性为true
后,min-height
属性设置拖拽后窗口的最小高度,min-width
属性设置拖拽后窗口的最小宽度。
',
'en-US':
- 'By setting theresize
drag property totrue
, the minimum width of the window after dragging can be set through themin-width
property.
'
+ 'Theresize
property can be used to set the drag property totrue
. Themin-height
property sets the minimum height of the window after dragging, and themin-width
property sets the minimum width of the window after dragging.'
},
- codeFiles: ['min-width.vue']
+ codeFiles: ['min-width-height.vue']
},
{
- demoId: 'min-height',
+ demoId: 'show-header-footer',
name: {
- 'zh-CN': '调整窗口后的最小高度',
- 'en-US': 'The Minimum Height Displayed By The Window After Adjusting Its Size'
+ 'zh-CN': '控制显示头部及底部',
+ 'en-US': 'Do Not Display Header and Bottom'
},
desc: {
'zh-CN':
- '可通过resize
属性设置可拖拽属性为true
后,min-height
属性设置拖拽后窗口的最小高度。
',
+ '可通过show-footer
属性设置是否显示底部,show-header
属性设置是否显示头部。
',
'en-US':
- 'By setting theresize
drag property totrue
, the minimum height of the window after dragging can be set through themin-height
property.
'
+ 'Set whether to display the bottom through theshow-footer
attribute, and whether to display the head through theshow-header
attribute.'
},
- codeFiles: ['min-height.vue']
- },
- {
- demoId: 'showFooter',
- name: {
- 'zh-CN': '不显示底部',
- 'en-US': 'Do Not Display Bottom'
- },
- desc: {
- 'zh-CN': '可通过show-footer
属性设置是否显示底部。
',
- 'en-US': 'Set whether to display the bottom throughshow-root
.
'
- },
- codeFiles: ['showFooter.vue']
- },
- {
- demoId: 'showHeader',
- name: {
- 'zh-CN': '不显示头部',
- 'en-US': 'Do Not Display The Head'
- },
- desc: {
- 'zh-CN': '可通过show-header
属性设置是否显示头部。
',
- 'en-US': 'Set whether to display the header throughshow-header
.
'
- },
- codeFiles: ['showHeader.vue']
+ codeFiles: ['show-header-footer.vue']
},
{
demoId: 'status',