ant-design-vue/components/menu/demo/horizontal.vue

55 lines
1.2 KiB
Vue
Raw Normal View History

2018-01-16 11:15:07 +00:00
<template>
<div>
2018-01-17 11:15:18 +00:00
<md>
## 顶部导航
水平的顶部导航菜单
</md>
2018-01-16 11:15:07 +00:00
<Menu
2018-01-17 11:15:18 +00:00
v-model="current"
2018-01-16 11:15:07 +00:00
mode="horizontal"
>
<MenuItem key="mail">
<Icon type="mail" />Navigation One
</MenuItem>
<MenuItem key="app" disabled>
<Icon type="appstore" />Navigation Two
</MenuItem>
<SubMenu>
2018-01-19 03:47:06 +00:00
<span slot="title"><Icon type="setting" />Navigation Three - Submenu</span>
2018-01-16 11:15:07 +00:00
<MenuItemGroup title="Item 1">
<MenuItem key="setting:1">Option 1</MenuItem>
<MenuItem key="setting:2">Option 2</MenuItem>
</MenuItemGroup>
<MenuItemGroup title="Item 2">
<MenuItem key="setting:3">Option 3</MenuItem>
<MenuItem key="setting:4">Option 4</MenuItem>
</MenuItemGroup>
</SubMenu>
<MenuItem key="alipay">
<a href="https://ant.design" target="_blank" rel="noopener noreferrer">Navigation Four - Link</a>
</MenuItem>
</Menu>
</div>
</template>
<script>
import { Menu, Icon } from 'antd'
const SubMenu = Menu.SubMenu
const MenuItemGroup = Menu.ItemGroup
const MenuItem = Menu.Item
export default {
data () {
return {
2018-01-17 11:15:18 +00:00
current: ['mail'],
2018-01-16 11:15:07 +00:00
}
},
components: {
Menu,
Icon,
SubMenu,
MenuItemGroup,
MenuItem,
},
}
</script>