Skip to content

Commit

Permalink
fix(menu): remove usage of height in menu demos (Tencent#3135)
Browse files Browse the repository at this point in the history
* fix(menu): remove usage of `height` in menu demos

* fix(menu): update snapshots
  • Loading branch information
Summer-Shen authored Apr 8, 2024
1 parent 1cae35d commit b88ada0
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/menu/_example-composition/closable-side.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<t-menu theme="light" defaultValue="2-1" :collapsed="collapsed" height="550px">
<t-menu theme="light" defaultValue="2-1" :collapsed="collapsed">
<template #logo>
<span>LOGO</span>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/menu/_example-composition/group-side.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<t-menu theme="light" defaultValue="item2" :collapsed="collapsed" @change="changeHandler" height="550px">
<t-menu theme="light" defaultValue="item2" :collapsed="collapsed" @change="changeHandler">
<template #logo>
<img :width="collapsed ? 35 : 136" :src="iconUrl" alt="logo" />
</template>
Expand Down
10 changes: 1 addition & 9 deletions src/menu/_example-composition/multi-side.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<template>
<div class="box">
<t-menu
theme="light"
defaultValue="3-2"
expandMutex
:defaultExpanded="expanded"
height="550px"
:collapsed="collapsed"
>
<t-menu theme="light" defaultValue="3-2" expandMutex :defaultExpanded="expanded" :collapsed="collapsed">
<t-submenu title="消息区" value="3">
<template #icon>
<icon name="mail" />
Expand Down Expand Up @@ -61,7 +54,6 @@
style="margin-left: 40px"
:expanded="expanded2"
@expand="expanded2 = $event"
height="550px"
:collapsed="collapsed2"
>
<t-menu-item value="item1">
Expand Down
4 changes: 2 additions & 2 deletions src/menu/_example-composition/side-menu-width.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="wrapper">
<t-menu defaultValue="item2" width="200px" height="550px" style="margin-right: 20px">
<t-menu defaultValue="item2" width="200px" style="margin-right: 20px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand All @@ -10,7 +10,7 @@
<t-menu-item value="item4">资源区</t-menu-item>
</t-menu>

<t-menu defaultValue="item2" :collapsed="collapsed" :width="['300px', 150]" height="550px">
<t-menu defaultValue="item2" :collapsed="collapsed" :width="['300px', 150]">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand Down
6 changes: 3 additions & 3 deletions src/menu/_example-composition/single-side.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="box">
<t-menu theme="light" defaultValue="item1" @change="changeHandler" style="margin-right: 40px" height="550px">
<t-menu theme="light" defaultValue="item1" @change="changeHandler" style="margin-right: 40px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand All @@ -15,7 +15,7 @@
<t-menu-item value="item9">资源编辑</t-menu-item>
</t-menu>

<t-menu theme="light" defaultValue="dashboard" style="margin-right: 40px" height="550px">
<t-menu theme="light" defaultValue="dashboard" style="margin-right: 40px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand Down Expand Up @@ -75,7 +75,7 @@
</t-menu-item>
</t-menu>

<t-menu theme="dark" defaultValue="dashboard" height="550px">
<t-menu theme="dark" defaultValue="dashboard">
<img slot="logo" height="28" src="https://tdesign.gtimg.com/site/baseLogo-dark.png" alt="logo" />
<t-menu-item value="dashboard">
<template #icon>
Expand Down
2 changes: 1 addition & 1 deletion src/menu/_example/closable-side.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<t-menu theme="light" defaultValue="2-1" :collapsed="collapsed" height="550px">
<t-menu theme="light" defaultValue="2-1" :collapsed="collapsed">
<template #logo>
<span>LOGO</span>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/menu/_example/group-side.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<t-menu theme="light" defaultValue="item2" :collapsed="collapsed" @change="changeHandler" height="550px">
<t-menu theme="light" defaultValue="item2" :collapsed="collapsed" @change="changeHandler">
<template #logo>
<img :width="collapsed ? 35 : 136" :src="iconUrl" alt="logo" />
</template>
Expand Down
10 changes: 1 addition & 9 deletions src/menu/_example/multi-side.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<template>
<div class="box">
<t-menu
theme="light"
defaultValue="3-2"
expandMutex
:defaultExpanded="expanded"
height="550px"
:collapsed="collapsed"
>
<t-menu theme="light" defaultValue="3-2" expandMutex :defaultExpanded="expanded" :collapsed="collapsed">
<t-submenu title="消息区" value="3">
<template #icon>
<icon name="mail" />
Expand Down Expand Up @@ -61,7 +54,6 @@
style="margin-left: 40px"
:expanded="expanded2"
@expand="expanded2 = $event"
height="550px"
:collapsed="collapsed2"
>
<t-menu-item value="item1">
Expand Down
4 changes: 2 additions & 2 deletions src/menu/_example/side-menu-width.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="wrapper">
<t-menu defaultValue="item2" width="200px" height="550px" style="margin-right: 20px">
<t-menu defaultValue="item2" width="200px" style="margin-right: 20px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand All @@ -10,7 +10,7 @@
<t-menu-item value="item4">资源区</t-menu-item>
</t-menu>

<t-menu defaultValue="item2" :collapsed="collapsed" :width="['300px', 150]" height="550px">
<t-menu defaultValue="item2" :collapsed="collapsed" :width="['300px', 150]">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand Down
6 changes: 3 additions & 3 deletions src/menu/_example/single-side.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="box">
<t-menu theme="light" defaultValue="item1" @change="changeHandler" style="margin-right: 40px" height="550px">
<t-menu theme="light" defaultValue="item1" @change="changeHandler" style="margin-right: 40px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand All @@ -15,7 +15,7 @@
<t-menu-item value="item9">资源编辑</t-menu-item>
</t-menu>

<t-menu theme="light" defaultValue="dashboard" style="margin-right: 40px" height="550px">
<t-menu theme="light" defaultValue="dashboard" style="margin-right: 40px">
<template #logo>
<img height="28" src="https://tdesign.gtimg.com/site/baseLogo-light.png" alt="logo" />
</template>
Expand Down Expand Up @@ -75,7 +75,7 @@
</t-menu-item>
</t-menu>

<t-menu theme="dark" defaultValue="dashboard" height="550px">
<t-menu theme="dark" defaultValue="dashboard">
<img slot="logo" height="28" src="https://tdesign.gtimg.com/site/baseLogo-dark.png" alt="logo" />
<t-menu-item value="dashboard">
<template #icon>
Expand Down
9 changes: 0 additions & 9 deletions test/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69739,7 +69739,6 @@ exports[`csr snapshot test > csr test ./src/loading/_example/wrap.vue 1`] = `
exports[`csr snapshot test > csr test ./src/menu/_example/closable-side.vue 1`] = `
<div
class="t-default-menu t-menu--light t-is-collapsed"
height="550px"
style="height: 100%; width: 64px;"
>
<div
Expand Down Expand Up @@ -70492,7 +70491,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/double.vue 1`] = `
exports[`csr snapshot test > csr test ./src/menu/_example/group-side.vue 1`] = `
<div
class="t-default-menu t-menu--light"
height="550px"
style="height: 100%; width: 232px;"
>
<div
Expand Down Expand Up @@ -71347,7 +71345,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-side.vue 1`] = `
<div
class="t-default-menu t-menu--light"
data-v-3a81e078=""
height="550px"
style="height: 100%; width: 232px;"
>
<div
Expand Down Expand Up @@ -71724,7 +71721,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/multi-side.vue 1`] = `
<div
class="t-default-menu t-menu--dark"
data-v-3a81e078=""
height="550px"
style="height: 100%; width: 232px; margin-left: 40px;"
>
<div
Expand Down Expand Up @@ -72694,7 +72690,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/side-menu-width.vue 1`
>
<div
class="t-default-menu t-menu--light"
height="550px"
style="height: 100%; width: 200px; margin-right: 20px;"
>
<div
Expand Down Expand Up @@ -72753,7 +72748,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/side-menu-width.vue 1`
</div>
<div
class="t-default-menu t-menu--light"
height="550px"
style="height: 100%; width: 300px;"
>
<div
Expand Down Expand Up @@ -73158,7 +73152,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/single-side.vue 1`] =
>
<div
class="t-default-menu t-menu--light"
height="550px"
style="height: 100%; width: 232px; margin-right: 40px;"
>
<div
Expand Down Expand Up @@ -73268,7 +73261,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/single-side.vue 1`] =
</div>
<div
class="t-default-menu t-menu--light"
height="550px"
style="height: 100%; width: 232px; margin-right: 40px;"
>
<div
Expand Down Expand Up @@ -73435,7 +73427,6 @@ exports[`csr snapshot test > csr test ./src/menu/_example/single-side.vue 1`] =
</div>
<div
class="t-default-menu t-menu--dark"
height="550px"
style="height: 100%; width: 232px;"
>
<div
Expand Down
Loading

0 comments on commit b88ada0

Please sign in to comment.