fixed #230
This commit is contained in:
梁灏 2017-01-23 09:55:32 +08:00
parent 763ac47d47
commit e069c7ae4e
2 changed files with 42 additions and 49 deletions

View file

@ -119,13 +119,15 @@
events: { events: {
'on-menu-item-select' (key) { 'on-menu-item-select' (key) {
this.activeKey = key; this.activeKey = key;
this.updateActiveKey();
this.$emit('on-select', key); this.$emit('on-select', key);
} }
}, },
watch: { watch: {
openKeys () { openKeys () {
this.$emit('on-open-change', this.openKeys); this.$emit('on-open-change', this.openKeys);
},
activeKey () {
this.updateActiveKey();
} }
} }
}; };

View file

@ -1,57 +1,48 @@
<template> <template>
<div style="margin: 50px;position:relative;top: 0;left: 0;"> <Menu mode="horizontal" :theme="theme1" :active-key.sync="ak">
<Menu mode="horizontal" :theme="theme1" active-key="1"> <Menu-item key="1">
<Menu-item key="1"> <Icon type="ios-paper"></Icon>
<Icon type="ios-paper"></Icon> 内容管理
内容管理 </Menu-item>
</Menu-item> <Menu-item key="2">
<Menu-item key="2"> <Icon type="ios-people"></Icon>
<Icon type="ios-people"></Icon> 用户管理
用户管理 </Menu-item>
</Menu-item> <Submenu key="3">
<Menu-item key="1"> <template slot="title">
<Icon type="ios-paper"></Icon> <Icon type="stats-bars"></Icon>
内容管理 统计分析
</Menu-item> </template>
<Menu-item key="2"> <Menu-group title="使用">
<Icon type="ios-people"></Icon> <Menu-item key="3-1">新增和启动</Menu-item>
用户管理 <Menu-item key="3-2">活跃分析</Menu-item>
</Menu-item> <Menu-item key="3-3">时段分析</Menu-item>
<Menu-item key="1"> </Menu-group>
<Icon type="ios-paper"></Icon> <Menu-group title="留存">
内容管理 <Menu-item key="3-4">用户留存</Menu-item>
</Menu-item> <Menu-item key="3-5">流失用户</Menu-item>
<Menu-item key="2"> </Menu-group>
<Icon type="ios-people"></Icon> </Submenu>
用户管理 <Menu-item key="4">
</Menu-item> <Icon type="settings"></Icon>
<Submenu key="3"> 综合设置
<template slot="title"> </Menu-item>
<Icon type="stats-bars"></Icon> </Menu>
统计分析 <br>
</template> <p>切换主题</p>
<Menu-group title="使用"> <Radio-group :model.sync="theme1">
<Menu-item key="3-1">新增和新</Menu-item> <Radio value="light"></Radio>
<Menu-item key="3-2">活跃分析</Menu-item> <Radio value="dark"></Radio>
<Menu-item key="3-3">时段分析</Menu-item> <Radio value="primary"></Radio>
</Menu-group> </Radio-group>
<Menu-group title="留存"> <i-button @click="ak = '2'">change</i-button>
<Menu-item key="3-4">用户留存</Menu-item>
<Menu-item key="3-5">流失用户</Menu-item>
</Menu-group>
</Submenu>
<Menu-item key="4">
<Icon type="settings"></Icon>
综合设置
</Menu-item>
</Menu>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
theme1: 'light' theme1: 'light',
ak: '1'
} }
} }
} }