refactor: 小修改
parent
c18a5ccc25
commit
cf2ac9b4de
|
@ -45,31 +45,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import createMenus from '@/view/router/menu'
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
menus: [
|
menus: undefined
|
||||||
{ title: '首页', path: '/index', icon: 'home' },
|
|
||||||
{ title: '加速服务', path: '/server', icon: 'thunderbolt' },
|
|
||||||
{ title: '系统代理', path: '/proxy', icon: 'deployment-unit' },
|
|
||||||
{
|
|
||||||
title: '应用',
|
|
||||||
path: '/plugin',
|
|
||||||
icon: 'api',
|
|
||||||
children: [
|
|
||||||
{ title: 'NPM加速', path: '/plugin/node', icon: 'like' },
|
|
||||||
{ title: '功能增强', path: '/plugin/overwall', icon: 'global' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this.menus = createMenus(this)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick (e) {
|
handleClick (e) {
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
export default function createMenus (app) {
|
||||||
|
const plugins = [
|
||||||
|
{ title: 'NPM加速', path: '/plugin/node', icon: 'like' }
|
||||||
|
]
|
||||||
|
const menus = [
|
||||||
|
{ title: '首页', path: '/index', icon: 'home' },
|
||||||
|
{ title: '加速服务', path: '/server', icon: 'thunderbolt' },
|
||||||
|
{ title: '系统代理', path: '/proxy', icon: 'deployment-unit' },
|
||||||
|
{
|
||||||
|
title: '应用',
|
||||||
|
path: '/plugin',
|
||||||
|
icon: 'api',
|
||||||
|
children: plugins
|
||||||
|
}
|
||||||
|
]
|
||||||
|
if (app.$global && app.$global.setting && app.$global.setting.overwall) {
|
||||||
|
plugins.push({ title: '功能增强', path: '/plugin/overwall', icon: 'global' })
|
||||||
|
}
|
||||||
|
return menus
|
||||||
|
}
|
Loading…
Reference in New Issue