You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/menu/demo/vertical.vue

61 lines
1.4 KiB

<template>
<div>
<md>
## 垂直菜单
子菜单是弹出的形式
</md>
<Menu
style="width: 256px"
mode="vertical"
@click="handleClick"
>
<MenuItem key="1">
<Icon type="mail" />
Navigation One
</MenuItem>
<MenuItem key="2">
<Icon type="calendar" />
Navigation Two
</MenuItem>
<SubMenu key="sub1">
<span slot="title"><Icon type="appstore" /><span>Navigation Three</span></span>
<MenuItem key="3">Option 3</MenuItem>
<MenuItem key="4">Option 4</MenuItem>
<SubMenu key="sub1-2" title="Submenu">
<MenuItem key="5">Option 5</MenuItem>
<MenuItem key="6">Option 6</MenuItem>
</SubMenu>
</SubMenu>
<SubMenu key="sub2">
<span slot="title"><Icon type="setting" /><span>Navigation Four</span></span>
<MenuItem key="7">Option 7</MenuItem>
<MenuItem key="8">Option 8</MenuItem>
<MenuItem key="9">Option 9</MenuItem>
<MenuItem key="10">Option 10</MenuItem>
</SubMenu>
</Menu>
</div>
</template>
<script>
import { Menu, Icon, Checkbox } from 'antd'
const SubMenu = Menu.SubMenu
const MenuItemGroup = Menu.ItemGroup
const MenuItem = Menu.Item
export default {
methods: {
handleClick (e) {
console.log('click ', e)
},
},
components: {
Menu,
Icon,
SubMenu,
MenuItemGroup,
MenuItem,
Checkbox,
},
}
</script>