-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pro:layout): fix sider border-right style (#659)
docs(pro:layout): add collapsed demo
- Loading branch information
Showing
8 changed files
with
121 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: | ||
zh: 折叠状态 | ||
en: Collapsed | ||
order: 4 | ||
--- | ||
|
||
## zh | ||
|
||
可以通过设置 `collapsed` 或者使用 `IxProLayoutSiderTrigger` 来控制侧边栏的折叠状态。 | ||
|
||
## en | ||
|
||
The collapse of the sider can be controlled by setting `collapsed` or using `IxProLayoutSiderTrigger`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<IxProLayout v-model:activeKey="activeKey" v-model:collapsed="collapsed" :menus="dataSource"> | ||
<template #headerExtra> | ||
<IxProLayoutSiderTrigger></IxProLayoutSiderTrigger> | ||
</template> | ||
<template #siderFooter> | ||
<IxProLayoutSiderTrigger></IxProLayoutSiderTrigger> | ||
</template> | ||
<div class="content"> | ||
<IxButton @click="collapsed = !collapsed">Change Collapsed</IxButton> | ||
</div> | ||
</IxProLayout> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { ProLayoutMenuData } from '@idux/pro/layout' | ||
import { ref } from 'vue' | ||
const activeKey = ref() | ||
const collapsed = ref(false) | ||
const dataSource: ProLayoutMenuData[] = [ | ||
{ | ||
type: 'sub', | ||
key: 'sub1', | ||
icon: 'setting', | ||
label: 'Sub Menu 1', | ||
children: [ | ||
{ type: 'item', key: 'item4', label: 'Item 4', icon: 'setting' }, | ||
{ type: 'item', key: 'item5', label: 'Item 5', icon: 'setting' }, | ||
{ type: 'divider', key: 'divider2' }, | ||
{ | ||
type: 'sub', | ||
key: 'sub2', | ||
icon: 'setting', | ||
label: 'Menu Sub 2', | ||
children: [ | ||
{ type: 'item', key: 'item6', label: 'Item 6' }, | ||
{ type: 'item', key: 'item7', label: 'Item 7' }, | ||
], | ||
}, | ||
{ | ||
type: 'sub', | ||
key: 'sub3', | ||
icon: 'setting', | ||
label: 'Menu Sub 3', | ||
children: [ | ||
{ type: 'item', key: 'item8', label: 'Item 8' }, | ||
{ type: 'item', key: 'item9', label: 'Item 9' }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'sub', | ||
key: 'sub4', | ||
icon: 'github', | ||
label: 'Menu Sub 4', | ||
children: [ | ||
{ type: 'item', key: 'item10', label: 'Item 10' }, | ||
{ type: 'item', key: 'item11', label: 'Item 11' }, | ||
], | ||
}, | ||
{ type: 'item', key: 'item2', icon: 'mail', label: 'Item 2' }, | ||
] | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.content { | ||
padding: 24px; | ||
line-height: 24px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
@import '../../../style/themes/default.less'; | ||
@import '../../../../components/layout/style/themes/default.less'; | ||
@import '../index.less'; | ||
@import './default.variable.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters