|
1 | 1 | <template>
|
2 |
| - <div id="app"> |
3 |
| - <lay-admin> |
4 |
| - <lay-header> |
5 |
| - <lay-logo>vue-layui</lay-logo> |
6 |
| - <lay-menu mode="horizontal" class="layui-layout-left"> |
7 |
| - <lay-menu-item :index="0"> |
8 |
| - <template slot="title"> |
9 |
| - <span>导航一</span> |
10 |
| - </template> |
11 |
| - <lay-menu-child-item title="test"></lay-menu-child-item> |
12 |
| - <lay-menu-child-item title="test"></lay-menu-child-item> |
13 |
| - </lay-menu-item> |
14 |
| - <lay-menu-item :index="1"> |
15 |
| - <template slot="title"> |
16 |
| - <span>导航一</span> |
17 |
| - </template> |
18 |
| - </lay-menu-item> |
19 |
| - <lay-menu-item :index="2"> |
20 |
| - <template slot="title"> |
21 |
| - <span>导航一</span> |
22 |
| - </template> |
23 |
| - </lay-menu-item> |
24 |
| - <lay-menu-item :index="3"> |
25 |
| - <template slot="title"> |
26 |
| - <span>导航一</span> |
27 |
| - </template> |
28 |
| - </lay-menu-item> |
29 |
| - </lay-menu> |
30 |
| - <lay-menu mode="horizontal" class="layui-layout-right"> |
31 |
| - <lay-menu-item :index="0"> |
32 |
| - <template slot="title"> |
33 |
| - <img src="https://avatars1.githubusercontent.com/u/23720738?s=460&v=4" |
34 |
| - class="layui-nav-img"> admin |
35 |
| - </template> |
36 |
| - <lay-menu-child-item title="基本资料"></lay-menu-child-item> |
37 |
| - <lay-menu-child-item title="安全设置"></lay-menu-child-item> |
38 |
| - </lay-menu-item> |
39 |
| - <lay-menu-item :index="0"> |
40 |
| - <template slot="title"> |
41 |
| - 退出 |
42 |
| - </template> |
43 |
| - </lay-menu-item> |
44 |
| - </lay-menu> |
45 |
| - </lay-header> |
46 |
| - <lay-side> |
47 |
| - <lay-menu :default-openeds="[0, 1, 2]"> |
48 |
| - <lay-menu-item :index="0"> |
49 |
| - <template slot="title"> |
50 |
| - <span>快速开始</span> |
51 |
| - </template> |
52 |
| - <lay-menu-child-item title="首页" :to="{name: 'home'}"></lay-menu-child-item> |
53 |
| - <lay-menu-child-item title="关于vue-layui" :to="{name: 'about'}"></lay-menu-child-item> |
54 |
| - </lay-menu-item> |
55 |
| - <lay-menu-item :index="1"> |
56 |
| - <template slot="title"> |
57 |
| - <span>布局</span> |
58 |
| - </template> |
59 |
| - <lay-menu-child-item title="栅格" :to="{name: 'grid'}"></lay-menu-child-item> |
60 |
| - <lay-menu-child-item title="后台布局" :to="{name: 'admin'}"></lay-menu-child-item> |
61 |
| - |
62 |
| - </lay-menu-item> |
63 |
| - <lay-menu-item :index="2"> |
64 |
| - <template slot="title"> |
65 |
| - <span>基本元素</span> |
66 |
| - </template> |
67 |
| - <lay-menu-child-item title="按钮" :to="{name: 'button'}"></lay-menu-child-item> |
68 |
| - <lay-menu-child-item title="表单" :to="{name: 'form'}"></lay-menu-child-item> |
69 |
| - <lay-menu-child-item title="导航/面包屑" :to="{name: 'nav'}"></lay-menu-child-item> |
70 |
| - <lay-menu-child-item title="选项卡" :to="{name: 'tabs'}"></lay-menu-child-item> |
71 |
| - <lay-menu-child-item title="进度条" :to="{name: 'progress'}"></lay-menu-child-item> |
72 |
| - <lay-menu-child-item title="面板" :to="{name: 'panel'}"></lay-menu-child-item> |
73 |
| - <lay-menu-child-item title="徽章" :to="{name: 'badge'}"></lay-menu-child-item> |
74 |
| - <lay-menu-child-item title="时间线" :to="{name: 'timeline'}"></lay-menu-child-item> |
75 |
| - <lay-menu-child-item title="静态表格" :to="{name: 'table'}"></lay-menu-child-item> |
76 |
| - <lay-menu-child-item title="动画" :to="{name: 'animation'}"></lay-menu-child-item> |
77 |
| - <lay-menu-child-item title="辅助元素" :to="{name: 'auxiliar'}"></lay-menu-child-item> |
78 |
| - </lay-menu-item> |
79 |
| - <lay-menu-item :index="3"> |
80 |
| - <template slot="title"> |
81 |
| - <span>组件示例</span> |
82 |
| - </template> |
83 |
| - <lay-menu-child-item title="弹出层" :to="{name: 'layer'}"></lay-menu-child-item> |
84 |
| - <lay-menu-child-item title="分页" :to="{name: 'laypage'}"></lay-menu-child-item> |
85 |
| - <lay-menu-child-item title="颜色选择器" :to="{name: 'colorPicker'}"></lay-menu-child-item> |
86 |
| - <lay-menu-child-item title="滑块" :to="{name: 'slider'}"></lay-menu-child-item> |
87 |
| - <lay-menu-child-item title="评分" :to="{name: 'rate'}"></lay-menu-child-item> |
88 |
| - <lay-menu-child-item title="轮播" :to="{name: 'carousel'}"></lay-menu-child-item> |
89 |
| - |
90 |
| - </lay-menu-item> |
91 |
| - |
92 |
| - </lay-menu> |
93 |
| - </lay-side> |
94 |
| - <lay-body> |
95 |
| - <div class="layui-main site-demo-body"> |
96 |
| - <router-view/> |
97 |
| - </div> |
98 |
| - |
99 |
| - </lay-body> |
100 |
| - <lay-footer style="text-align: center"> |
101 |
| - <span>© 2018</span> |
102 |
| - <a class="deom-pl10" href="http://jskou.com" target="_blank">jskou.com</a> |
103 |
| - <span class="deom-pl10">MIT license</span> |
104 |
| - <a class="deom-pl10" href="https://github.com/kouchao/vue-layui" target="_blank">GitHub</a> |
105 |
| - <a class="deom-pl10" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=37078202000111" target="_blank">鲁公网安备 37078202000111号</a> |
106 |
| - <span class="deom-pl10">|</span> |
107 |
| - <a class="deom-pl10" href="http://www.miibeian.gov.cn/" target="_blank">鲁ICP备17028069号-2</a> |
108 |
| - </lay-footer> |
109 |
| - |
110 |
| - </lay-admin> |
111 |
| - |
112 |
| - |
113 |
| - </div> |
| 2 | + <div id="app"> |
| 3 | + <lay-admin :collapse.sync="collapse"> |
| 4 | + <lay-side> |
| 5 | + <lay-menu :default-openeds="[0, 1, 2]"> |
| 6 | + <lay-menu-item :index="0" icon="component" title="快速开始"> |
| 7 | + <lay-menu-child-item title="首页" :to="{name: 'home'}"></lay-menu-child-item> |
| 8 | + <lay-menu-child-item title="关于vue-layui" :to="{name: 'about'}"></lay-menu-child-item> |
| 9 | + </lay-menu-item> |
| 10 | + <lay-menu-item :index="1" icon="component"> |
| 11 | + <template slot="title"> |
| 12 | + <span>布局</span> |
| 13 | + </template> |
| 14 | + <lay-menu-child-item title="栅格" :to="{name: 'grid'}"></lay-menu-child-item> |
| 15 | + <lay-menu-child-item title="后台布局" :to="{name: 'admin'}"></lay-menu-child-item> |
| 16 | + </lay-menu-item> |
| 17 | + <lay-menu-item :index="2" icon="component"> |
| 18 | + <template slot="title"> |
| 19 | + <span>基本元素</span> |
| 20 | + </template> |
| 21 | + <lay-menu-child-item title="按钮" :to="{name: 'button'}"></lay-menu-child-item> |
| 22 | + <lay-menu-child-item title="表单" :to="{name: 'form'}"></lay-menu-child-item> |
| 23 | + <lay-menu-child-item title="导航/面包屑" :to="{name: 'nav'}"></lay-menu-child-item> |
| 24 | + <lay-menu-child-item title="选项卡" :to="{name: 'tabs'}"></lay-menu-child-item> |
| 25 | + <lay-menu-child-item title="进度条" :to="{name: 'progress'}"></lay-menu-child-item> |
| 26 | + <lay-menu-child-item title="面板" :to="{name: 'panel'}"></lay-menu-child-item> |
| 27 | + <lay-menu-child-item title="徽章" :to="{name: 'badge'}"></lay-menu-child-item> |
| 28 | + <lay-menu-child-item title="时间线" :to="{name: 'timeline'}"></lay-menu-child-item> |
| 29 | + <lay-menu-child-item title="静态表格" :to="{name: 'table'}"></lay-menu-child-item> |
| 30 | + <lay-menu-child-item title="动画" :to="{name: 'animation'}"></lay-menu-child-item> |
| 31 | + <lay-menu-child-item title="辅助元素" :to="{name: 'auxiliar'}"></lay-menu-child-item> |
| 32 | + </lay-menu-item> |
| 33 | + <lay-menu-item :index="3" icon="component"> |
| 34 | + <template slot="title"> |
| 35 | + <span>组件示例</span> |
| 36 | + </template> |
| 37 | + <lay-menu-child-item title="弹出层" :to="{name: 'layer'}"></lay-menu-child-item> |
| 38 | + <lay-menu-child-item title="分页" :to="{name: 'laypage'}"></lay-menu-child-item> |
| 39 | + <lay-menu-child-item title="颜色选择器" :to="{name: 'colorPicker'}"></lay-menu-child-item> |
| 40 | + <lay-menu-child-item title="滑块" :to="{name: 'slider'}"></lay-menu-child-item> |
| 41 | + <lay-menu-child-item title="评分" :to="{name: 'rate'}"></lay-menu-child-item> |
| 42 | + <lay-menu-child-item title="轮播" :to="{name: 'carousel'}"></lay-menu-child-item> |
| 43 | + </lay-menu-item> |
| 44 | + </lay-menu> |
| 45 | + </lay-side> |
| 46 | + <div> |
| 47 | + <lay-header> |
| 48 | + <lay-logo> |
| 49 | + <span v-if="!collapse">vue-layui</span> |
| 50 | + <img v-else width="30" src="https://cos.jskou.com/vue-layui-logo.png" alt> |
| 51 | + </lay-logo> |
| 52 | + <lay-menu |
| 53 | + mode="horizontal" |
| 54 | + class="layui-layout-left" |
| 55 | + :class="{ |
| 56 | + 'is-collapse': collapse |
| 57 | + }"> |
| 58 | + <lay-menu-item :index="0"> |
| 59 | + <template slot="title"> |
| 60 | + <i |
| 61 | + @click="collapse = !collapse" |
| 62 | + class="layui-icon" |
| 63 | + :class="{ |
| 64 | + 'layui-icon-spread-left': collapse, |
| 65 | + 'layui-icon-shrink-right': !collapse |
| 66 | + }" |
| 67 | + /> |
| 68 | + </template> |
| 69 | + </lay-menu-item> |
| 70 | + <lay-menu-item :index="1"> |
| 71 | + <template slot="title"> |
| 72 | + <span>导航一</span> |
| 73 | + </template> |
| 74 | + <lay-menu-child-item title="基本资料"></lay-menu-child-item> |
| 75 | + <lay-menu-child-item title="安全设置"></lay-menu-child-item> |
| 76 | + </lay-menu-item> |
| 77 | + <lay-menu-item :index="2"> |
| 78 | + <template slot="title"> |
| 79 | + <span>导航一</span> |
| 80 | + </template> |
| 81 | + </lay-menu-item> |
| 82 | + <lay-menu-item :index="3"> |
| 83 | + <template slot="title"> |
| 84 | + <span>导航一</span> |
| 85 | + </template> |
| 86 | + </lay-menu-item> |
| 87 | + </lay-menu> |
| 88 | + <lay-menu mode="horizontal" class="layui-layout-right"> |
| 89 | + <lay-menu-item :index="0"> |
| 90 | + <template slot="title"> |
| 91 | + <img |
| 92 | + src="https://avatars1.githubusercontent.com/u/23720738?s=460&v=4" |
| 93 | + class="layui-nav-img" |
| 94 | + > admin |
| 95 | + </template> |
| 96 | + <lay-menu-child-item title="基本资料"></lay-menu-child-item> |
| 97 | + <lay-menu-child-item title="安全设置"></lay-menu-child-item> |
| 98 | + </lay-menu-item> |
| 99 | + <lay-menu-item :index="0"> |
| 100 | + <template slot="title">退出</template> |
| 101 | + </lay-menu-item> |
| 102 | + </lay-menu> |
| 103 | + </lay-header> |
| 104 | + <lay-body> |
| 105 | + <div class="layui-main site-demo-body"> |
| 106 | + <router-view/> |
| 107 | + </div> |
| 108 | + </lay-body> |
| 109 | + <lay-footer style="text-align: center"> |
| 110 | + <span>© 2018</span> |
| 111 | + <a class="deom-pl10" href="http://jskou.com" target="_blank">jskou.com</a> |
| 112 | + <span class="deom-pl10">MIT license</span> |
| 113 | + <a class="deom-pl10" href="https://github.com/kouchao/vue-layui" target="_blank">GitHub</a> |
| 114 | + <a |
| 115 | + class="deom-pl10" |
| 116 | + href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=37078202000111" |
| 117 | + target="_blank" |
| 118 | + >鲁公网安备 37078202000111号</a> |
| 119 | + <span class="deom-pl10">|</span> |
| 120 | + <a class="deom-pl10" href="http://www.miibeian.gov.cn/" target="_blank">鲁ICP备17028069号-2</a> |
| 121 | + </lay-footer> |
| 122 | + </div> |
| 123 | + </lay-admin> |
| 124 | + </div> |
114 | 125 | </template>
|
115 | 126 |
|
| 127 | +<script> |
| 128 | +export default { |
| 129 | + data() { |
| 130 | + return { |
| 131 | + collapse: true |
| 132 | + }; |
| 133 | + } |
| 134 | +}; |
| 135 | +</script> |
| 136 | + |
116 | 137 | <style>
|
| 138 | +.layui-layout-admin .site-demo-body { |
| 139 | + top: 30px; |
| 140 | +} |
| 141 | +
|
| 142 | +.deom-pl10 { |
| 143 | + margin-left: 10px; |
| 144 | +} |
117 | 145 |
|
118 |
| - .layui-layout-admin .site-demo-body { |
119 |
| - top: 30px; |
120 |
| - } |
| 146 | +.layui-layout-left { |
| 147 | + transition: 0.5s; |
| 148 | +} |
121 | 149 |
|
122 |
| - .deom-pl10 { |
123 |
| - margin-left: 10px; |
124 |
| - } |
| 150 | +.layui-layout-left.is-collapse { |
| 151 | + left: 60px; |
| 152 | +} |
125 | 153 | </style>
|
0 commit comments