Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions src/menu/_usage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,39 @@
</template>
<template #headMenu="{ configProps }">
<div :style="{ padding: '24px', background: 'var(--bg-color-page)', borderRadius: '3px' }">
<t-head-menu style="marginbottom: 20px" v-bind="configProps">
<t-head-menu style="margin-bottom: 20px" v-bind="configProps">
<template #logo>
<img src="https://www.tencent.com/img/index/menu_logo_hover.png" width="136" />
</template>

<t-menu-item value="0">
<span>菜单1</span>
</t-menu-item>
<t-menu-item value="1">
<span>菜单2</span>
<template #icon>
<t-icon name="app" />
</template>
仪表盘
</t-menu-item>

<t-submenu value="1" title="资源列表">
<template #icon>
<t-icon name="code" />
</template>
<t-menu-item value="1-1" disabled>
<span>菜单二</span>
</t-menu-item>
</t-submenu>
<t-submenu value="2" title="调度平台">
<template #icon>
<t-icon name="file" />
</template>
<t-submenu value="2-1" title="二级菜单-1">
<t-menu-item value="3-1">三级菜单-1</t-menu-item>
<t-menu-item value="3-2">三级菜单-2</t-menu-item>
<t-menu-item value="3-3">三级菜单-3</t-menu-item>
</t-submenu>
<t-menu-item value="2-2">
<span>二级菜单-2</span>
</t-menu-item>
</t-submenu>
</t-head-menu>
</div>
</template>
Expand Down
3 changes: 2 additions & 1 deletion src/menu/submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ export default defineComponent({
const rippleVal = (this.keepAnimation as Record<AnimationType, boolean>).ripple ? this.rippleColor : false;
const normalSubmenu = [
<div v-ripple={rippleVal} class={this.submenuClass} onClick={this.handleSubmenuItemClick}>
{renderTNodeJSX(this, 'title')}
{icon}
<span class={[`${this.classPrefix}-menu__content`]}>{renderTNodeJSX(this, 'title')}</span>
</div>,
<ul style="opacity: 0; width: 0; height: 0; overflow: hidden">{renderContent(this, 'default', 'content')}</ul>,
];
Expand Down
154 changes: 123 additions & 31 deletions test/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68881,9 +68881,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/double.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom t-is-opened"
>
<span
data-v-3a8c765e=""
class="t-menu__content"
>
菜单1
<span
data-v-3a8c765e=""
>
菜单1
</span>
</span>
</div>
<ul
Expand Down Expand Up @@ -68929,9 +68933,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/double.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
<span
data-v-3a8c765e=""
class="t-menu__content"
>
菜单2
<span
data-v-3a8c765e=""
>
菜单2
</span>
</span>
</div>
<ul
Expand Down Expand Up @@ -69086,9 +69094,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/double.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom t-is-opened"
>
<span
data-v-3a8c765e=""
class="t-menu__content"
>
菜单1
<span
data-v-3a8c765e=""
>
菜单1
</span>
</span>
</div>
<ul
Expand Down Expand Up @@ -69134,9 +69146,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/double.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
<span
data-v-3a8c765e=""
class="t-menu__content"
>
菜单2
<span
data-v-3a8c765e=""
>
菜单2
</span>
</span>
</div>
<ul
Expand Down Expand Up @@ -69876,7 +69892,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/head-menu-tile.vue 1`]
>
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
/>
>
<span
class="t-menu__content"
/>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
>
Expand Down Expand Up @@ -69928,7 +69948,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/head-menu-tile.vue 1`]
>
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
/>
>
<span
class="t-menu__content"
/>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
>
Expand Down Expand Up @@ -69980,7 +70004,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/head-menu-tile.vue 1`]
>
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
/>
>
<span
class="t-menu__content"
/>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
>
Expand Down Expand Up @@ -70151,9 +70179,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom t-is-opened"
>
<span
data-v-29e136fe=""
class="t-menu__content"
>
菜单1
<span
data-v-29e136fe=""
>
菜单1
</span>
</span>
</div>
<ul
Expand All @@ -70166,7 +70198,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-1
<span
class="t-menu__content"
>
子菜单1-1
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70210,7 +70246,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-2
<span
class="t-menu__content"
>
子菜单1-2
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70254,7 +70294,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-3
<span
class="t-menu__content"
>
子菜单1-3
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70301,9 +70345,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
<span
data-v-29e136fe=""
class="t-menu__content"
>
菜单2
<span
data-v-29e136fe=""
>
菜单2
</span>
</span>
</div>
<ul
Expand All @@ -70316,7 +70364,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-1
<span
class="t-menu__content"
>
子菜单2-1
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70360,7 +70412,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-2
<span
class="t-menu__content"
>
子菜单2-2
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70404,7 +70460,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-3
<span
class="t-menu__content"
>
子菜单2-3
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70560,9 +70620,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom t-is-opened"
>
<span
data-v-29e136fe=""
class="t-menu__content"
>
菜单1
<span
data-v-29e136fe=""
>
菜单1
</span>
</span>
</div>
<ul
Expand All @@ -70575,7 +70639,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-1
<span
class="t-menu__content"
>
子菜单1-1
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70619,7 +70687,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-2
<span
class="t-menu__content"
>
子菜单1-2
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70663,7 +70735,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单1-3
<span
class="t-menu__content"
>
子菜单1-3
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70710,9 +70786,13 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
<span
data-v-29e136fe=""
class="t-menu__content"
>
菜单2
<span
data-v-29e136fe=""
>
菜单2
</span>
</span>
</div>
<ul
Expand All @@ -70725,7 +70805,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-1
<span
class="t-menu__content"
>
子菜单2-1
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70769,7 +70853,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-2
<span
class="t-menu__content"
>
子菜单2-2
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down Expand Up @@ -70813,7 +70901,11 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-head.vue 1`] = `
<div
class="t-menu__item t-menu__item-spacer t-menu__item-spacer--bottom"
>
子菜单2-3
<span
class="t-menu__content"
>
子菜单2-3
</span>
</div>
<ul
style="opacity: 0; width: 0px; height: 0px; overflow: hidden;"
Expand Down
Loading