diff --git a/examples/sites/demos/pc/app/action-menu/add-icon-composition-api.vue b/examples/sites/demos/pc/app/action-menu/add-icon-composition-api.vue deleted file mode 100644 index af2b9138e..000000000 --- a/examples/sites/demos/pc/app/action-menu/add-icon-composition-api.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/action-menu/add-icon.vue b/examples/sites/demos/pc/app/action-menu/add-icon.vue deleted file mode 100644 index 1fce60d69..000000000 --- a/examples/sites/demos/pc/app/action-menu/add-icon.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/examples/sites/demos/pc/app/action-menu/basic-usage.vue b/examples/sites/demos/pc/app/action-menu/basic-usage.vue index b4bace8a5..77361dc0e 100644 --- a/examples/sites/demos/pc/app/action-menu/basic-usage.vue +++ b/examples/sites/demos/pc/app/action-menu/basic-usage.vue @@ -1,5 +1,5 @@ + + diff --git a/examples/sites/demos/pc/app/action-menu/icon.vue b/examples/sites/demos/pc/app/action-menu/icon.vue new file mode 100644 index 000000000..4d003acc5 --- /dev/null +++ b/examples/sites/demos/pc/app/action-menu/icon.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/examples/sites/demos/pc/app/action-menu/popper-class.spec.ts b/examples/sites/demos/pc/app/action-menu/popper-class.spec.ts index faf9e334b..ba12438af 100644 --- a/examples/sites/demos/pc/app/action-menu/popper-class.spec.ts +++ b/examples/sites/demos/pc/app/action-menu/popper-class.spec.ts @@ -9,8 +9,9 @@ test('弹框样式', async ({ page }) => { const visibleItem = actionMenu.locator('.tiny-action-menu__item') const dropDownMenu = page.locator('body > .tiny-dropdown-menu.tiny-popper') - await page.waitForTimeout(300) + await page.waitForTimeout(1300) await visibleItem.last().hover() + await page.waitForTimeout(200) await expect(dropDownMenu).toHaveClass(/custom-action-menu/) await expect(dropDownMenu).toHaveCSS('background-color', 'rgb(250, 235, 215)') }) diff --git a/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js b/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js index 6d6d8b769..b34f935c8 100644 --- a/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js +++ b/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js @@ -22,14 +22,15 @@ export default { 'codeFiles': ['disabled.vue'] }, { - 'demoId': 'add-icon', + 'demoId': 'icon', 'name': { 'zh-CN': '图标', 'en-US': 'Icon' }, 'desc': { - 'zh-CN': '通过属性 icon 配置菜单按钮前的图标。', + 'zh-CN': + '通过 icon 属性设置菜单项的图标,suffix-icon 设置下拉触发源图标,show-icon 设置是否显示下拉触发源图标。', 'en-US': - 'The icon attribute is used to Configure the icon in front of the menu button.' + 'Set the icon of the attribute setting menu item through icon, set the drop-down trigger source icon through suffix-icon, and set whether to display the drop-down trigger source icon through show-icon.' }, - 'codeFiles': ['add-icon.vue'] + 'codeFiles': ['icon.vue'] }, { 'demoId': 'text-field', @@ -139,13 +140,6 @@ export default { }, 'demoId': 'more-text' }, - { - 'name': 'icon', - 'type': 'component', - 'defaultValue': '', - 'desc': { 'zh-CN': '菜单项显示值前的图标', 'en-US': 'Icon of a menu item' }, - 'demId': 'add-icon' - }, { 'name': 'options', 'type': 'IItemData[]', @@ -198,6 +192,16 @@ export default { }, 'demoId': 'disabled' }, + { + 'name': 'options.icon', + 'type': 'VueComponent', + 'defaultValue': '', + 'desc': { + 'zh-CN': '菜单项图标', + 'en-US': 'Icon of a menu item' + }, + 'demId': 'icon' + }, { 'name': 'popper-class', 'type': 'string', @@ -211,13 +215,33 @@ export default { { 'name': 'spacing', 'type': 'string | number', - 'defaultValue': '5px', + 'defaultValue': "'5px'", 'desc': { 'zh-CN': '菜单按钮之间的间距', 'en-US': 'Spacing between menu buttons' }, 'demoId': 'spacing' }, + { + 'name': 'suffix-icon', + 'type': 'VueComponent', + 'defaultValue': '', + 'desc': { + 'zh-CN': '下拉触发源图标', + 'en-US': 'Dropdown trigger source icon' + }, + 'demoId': 'icon' + }, + { + 'name': 'show-icon', + 'type': 'boolean', + 'defaultValue': 'true', + 'desc': { + 'zh-CN': '是否显示下拉触发源图标', + 'en-US': 'Is the dropdown trigger source icon displayed' + }, + 'demoId': 'icon' + }, { 'name': 'text-field', 'type': 'string', diff --git a/examples/sites/demos/pc/app/dropdown/events-composition-api.vue b/examples/sites/demos/pc/app/dropdown/events-composition-api.vue index e51e5e7a8..370573f24 100644 --- a/examples/sites/demos/pc/app/dropdown/events-composition-api.vue +++ b/examples/sites/demos/pc/app/dropdown/events-composition-api.vue @@ -19,7 +19,7 @@

场景2:配置式

- + diff --git a/examples/sites/demos/pc/app/dropdown/events.spec.ts b/examples/sites/demos/pc/app/dropdown/events.spec.ts index 0db4c75c1..01ba126de 100644 --- a/examples/sites/demos/pc/app/dropdown/events.spec.ts +++ b/examples/sites/demos/pc/app/dropdown/events.spec.ts @@ -35,6 +35,7 @@ test('配置式内置事件', async ({ page }) => { const wrap = page.locator('#events') const notify = page.locator('.tiny-notify') const dropDown = wrap.locator('.tiny-dropdown').nth(1) + await expect(dropDown).toHaveClass(/options-event/) const dropDownMenuItem = page.locator('body > .tiny-dropdown-menu > .tiny-dropdown-item') diff --git a/examples/sites/demos/pc/app/dropdown/multi-level-composition-api.vue b/examples/sites/demos/pc/app/dropdown/multi-level-composition-api.vue index 72ea87e02..0720ad848 100644 --- a/examples/sites/demos/pc/app/dropdown/multi-level-composition-api.vue +++ b/examples/sites/demos/pc/app/dropdown/multi-level-composition-api.vue @@ -1,7 +1,7 @@