This commit is contained in:
Aresn 2017-06-09 17:35:18 +08:00
parent 55dbf62d68
commit a8a03995fa
2 changed files with 43 additions and 44 deletions

View file

@ -1,8 +1,6 @@
<template> <template>
<div> <div>
<Row> <Menu :theme="theme2" accordion @on-open-change="handleChange">
<i-col span="8">
<Menu :theme="theme2">
<Submenu name="1"> <Submenu name="1">
<template slot="title"> <template slot="title">
<Icon type="ios-paper"></Icon> <Icon type="ios-paper"></Icon>
@ -36,14 +34,6 @@
</Menu-group> </Menu-group>
</Submenu> </Submenu>
</Menu> </Menu>
</i-col>
</Row>
<br>
<p>切换主题</p>
<Radio-group v-model="theme2">
<Radio label="light"></Radio>
<Radio label="dark"></Radio>
</Radio-group>
</div> </div>
</template> </template>
<script> <script>
@ -52,6 +42,11 @@
return { return {
theme2: 'light' theme2: 'light'
} }
},
methods: {
handleChange (val) {
console.log(val);
}
} }
} }
</script> </script>

View file

@ -81,6 +81,10 @@
this.openNames.splice(index, 1); this.openNames.splice(index, 1);
} else { } else {
this.openNames.push(name); this.openNames.push(name);
if (this.accordion) {
this.openNames.splice(0, this.openNames.length);
this.openNames.push(name);
}
} }
}, },
updateOpened () { updateOpened () {