mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-01 11:38:36 +08:00
fix: menu demo
This commit is contained in:
parent
6fa835161f
commit
20a6973178
@ -32,12 +32,12 @@ export default {
|
||||
<div>
|
||||
<md cn={md.cn} us={md.us}/>
|
||||
<Horizontal />
|
||||
<InlineCollapsed />
|
||||
<Inline />
|
||||
<InlineCollapsed />
|
||||
<SiderCurrent />
|
||||
<SwitchMode />
|
||||
<Theme />
|
||||
<Vertical />
|
||||
<Theme />
|
||||
<SwitchMode />
|
||||
<Template />
|
||||
<api>
|
||||
<CN slot='cn' />
|
||||
|
@ -11,9 +11,15 @@ Show the dynamic switching mode (between 'inline' and 'vertical').
|
||||
```html
|
||||
<template>
|
||||
<div>
|
||||
<a-checkbox @change="changeMode" /> Change Mode
|
||||
<a-switch
|
||||
:defaultChecked="false"
|
||||
@change="changeMode"
|
||||
/> Change Mode
|
||||
<span className="ant-divider" style="margin: 0 1em"/>
|
||||
<a-checkbox @change="changeTheme" /> Change Theme
|
||||
<a-switch
|
||||
:defaultChecked="false"
|
||||
@change="changeTheme"
|
||||
/> Change Theme
|
||||
<br />
|
||||
<br />
|
||||
<a-menu
|
||||
@ -59,11 +65,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeMode ({ target }) {
|
||||
this.mode = target.checked ? 'vertical' : 'inline'
|
||||
changeMode (checked) {
|
||||
this.mode = checked ? 'vertical' : 'inline'
|
||||
},
|
||||
changeTheme ({ target }) {
|
||||
this.theme = target.checked ? 'dark' : 'light'
|
||||
changeTheme (checked) {
|
||||
this.theme = checked ? 'dark' : 'light'
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -11,7 +11,12 @@ There are two built-in themes: 'light' and 'dark'. The default value is 'light'.
|
||||
```html
|
||||
<template>
|
||||
<div>
|
||||
<a-checkbox @change="changeTheme" /> Change Theme
|
||||
<a-switch
|
||||
defaultChecked
|
||||
@change="changeTheme"
|
||||
checkedChildren="dark"
|
||||
unCheckedChildren="light"
|
||||
/>
|
||||
<br />
|
||||
<br />
|
||||
<a-menu
|
||||
@ -63,8 +68,8 @@ export default {
|
||||
console.log('click ', e)
|
||||
this.current = e.key
|
||||
},
|
||||
changeTheme ({ target }) {
|
||||
this.theme = target.checked ? 'light' : 'dark'
|
||||
changeTheme (checked) {
|
||||
this.theme = checked ? 'dark' : 'light'
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user