commit | author | age
|
9bcb19
|
1 |
<template> |
I |
2 |
<a-layout-sider |
|
3 |
:class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]" |
|
4 |
width="230px" |
|
5 |
:collapsible="collapsible" |
|
6 |
v-model="collapsed" |
|
7 |
:trigger="null"> |
|
8 |
<logo /> |
|
9 |
<s-menu |
|
10 |
:collapsed="collapsed" |
|
11 |
:menu="menus" |
|
12 |
:theme="theme" |
|
13 |
:mode="mode" |
|
14 |
@select="onSelect" |
|
15 |
></s-menu> |
|
16 |
</a-layout-sider> |
|
17 |
|
|
18 |
</template> |
|
19 |
|
|
20 |
<script> |
|
21 |
import Logo from '@/components/tools/Logo' |
|
22 |
import SMenu from './index' |
|
23 |
import { mixin, mixinDevice } from '@/utils/mixin' |
|
24 |
|
|
25 |
export default { |
|
26 |
name: 'SideMenu', |
|
27 |
components: { Logo, SMenu }, |
|
28 |
mixins: [mixin, mixinDevice], |
|
29 |
props: { |
|
30 |
mode: { |
|
31 |
type: String, |
|
32 |
required: false, |
|
33 |
default: 'inline' |
|
34 |
}, |
|
35 |
theme: { |
|
36 |
type: String, |
|
37 |
required: false, |
|
38 |
default: 'dark' |
|
39 |
}, |
|
40 |
collapsible: { |
|
41 |
type: Boolean, |
|
42 |
required: false, |
|
43 |
default: false |
|
44 |
}, |
|
45 |
collapsed: { |
|
46 |
type: Boolean, |
|
47 |
required: false, |
|
48 |
default: false |
|
49 |
}, |
|
50 |
menus: { |
|
51 |
type: Array, |
|
52 |
required: true |
|
53 |
} |
|
54 |
}, |
|
55 |
methods: { |
|
56 |
onSelect (obj) { |
|
57 |
this.$emit('menuSelect', obj) |
|
58 |
} |
|
59 |
} |
|
60 |
} |
|
61 |
</script> |