ant-design-vue/components/menu/demo/inline.md

78 lines
2.1 KiB
Markdown
Raw Normal View History

2018-03-20 13:48:01 +00:00
<cn>
#### 内åĩŒčœå•
垂į›´čœå•īŧŒå­čœå•å†…åĩŒåœ¨čœå•åŒē域。
</cn>
<us>
#### Inline menu
Vertical menu with inline submenus.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2018-03-20 13:48:01 +00:00
<template>
2019-09-28 12:45:07 +00:00
<div>
<a-menu
@click="handleClick"
style="width: 256px"
:defaultSelectedKeys="['1']"
:openKeys.sync="openKeys"
mode="inline"
>
<a-sub-menu key="sub1" @titleClick="titleClick">
<span slot="title"><a-icon type="mail" /><span>Navigation One</span></span>
<a-menu-item-group key="g1">
<template slot="title"
><a-icon type="qq" /><span>Item 1</span></template
>
<a-menu-item key="1">Option 1</a-menu-item>
<a-menu-item key="2">Option 2</a-menu-item>
</a-menu-item-group>
<a-menu-item-group key="g2" title="Item 2">
<a-menu-item key="3">Option 3</a-menu-item>
<a-menu-item key="4">Option 4</a-menu-item>
</a-menu-item-group>
2018-03-20 13:48:01 +00:00
</a-sub-menu>
2019-09-28 12:45:07 +00:00
<a-sub-menu key="sub2" @titleClick="titleClick">
<span slot="title"><a-icon type="appstore" /><span>Navigation Two</span></span>
<a-menu-item key="5">Option 5</a-menu-item>
<a-menu-item key="6">Option 6</a-menu-item>
<a-sub-menu key="sub3" title="Submenu">
<a-menu-item key="7">Option 7</a-menu-item>
<a-menu-item key="8">Option 8</a-menu-item>
</a-sub-menu>
</a-sub-menu>
<a-sub-menu key="sub4">
<span slot="title"><a-icon type="setting" /><span>Navigation Three</span></span>
<a-menu-item key="9">Option 9</a-menu-item>
<a-menu-item key="10">Option 10</a-menu-item>
<a-menu-item key="11">Option 11</a-menu-item>
<a-menu-item key="12">Option 12</a-menu-item>
</a-sub-menu>
</a-menu>
</div>
2018-03-20 13:48:01 +00:00
</template>
<script>
2019-09-28 12:45:07 +00:00
export default {
data() {
return {
current: ['mail'],
openKeys: ['sub1'],
};
2018-03-20 13:48:01 +00:00
},
2019-09-28 12:45:07 +00:00
methods: {
handleClick(e) {
console.log('click', e);
},
titleClick(e) {
console.log('titleClick', e);
},
2018-03-20 13:48:01 +00:00
},
2019-09-28 12:45:07 +00:00
watch: {
openKeys(val) {
console.log('openKeys', val);
},
2018-03-20 13:48:01 +00:00
},
2019-09-28 12:45:07 +00:00
};
2018-03-20 13:48:01 +00:00
</script>
```