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,22 +1,5 @@
<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">
<Icon type="ios-paper"></Icon>
内容管理
</Menu-item>
<Menu-item key="2">
<Icon type="ios-people"></Icon>
用户管理
</Menu-item>
<Menu-item key="1">
<Icon type="ios-paper"></Icon>
内容管理
</Menu-item>
<Menu-item key="2">
<Icon type="ios-people"></Icon>
用户管理
</Menu-item>
<Menu-item key="1"> <Menu-item key="1">
<Icon type="ios-paper"></Icon> <Icon type="ios-paper"></Icon>
内容管理 内容管理
@ -31,7 +14,7 @@
统计分析 统计分析
</template> </template>
<Menu-group title="使用"> <Menu-group title="使用">
<Menu-item key="3-1">新增和</Menu-item> <Menu-item key="3-1">新增和启动</Menu-item>
<Menu-item key="3-2">活跃分析</Menu-item> <Menu-item key="3-2">活跃分析</Menu-item>
<Menu-item key="3-3">时段分析</Menu-item> <Menu-item key="3-3">时段分析</Menu-item>
</Menu-group> </Menu-group>
@ -45,13 +28,21 @@
综合设置 综合设置
</Menu-item> </Menu-item>
</Menu> </Menu>
</div> <br>
<p>切换主题</p>
<Radio-group :model.sync="theme1">
<Radio value="light"></Radio>
<Radio value="dark"></Radio>
<Radio value="primary"></Radio>
</Radio-group>
<i-button @click="ak = '2'">change</i-button>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
theme1: 'light' theme1: 'light',
ak: '1'
} }
} }
} }