refactor: 小修改

pull/67/head
xiaojunnuo 2020-12-02 17:03:58 +08:00
parent c18a5ccc25
commit cf2ac9b4de
2 changed files with 23 additions and 14 deletions

View File

@ -45,31 +45,20 @@
</template>
<script>
import createMenus from '@/view/router/menu'
export default {
name: 'App',
components: {
},
data () {
return {
menus: [
{ 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' }
]
}
]
menus: undefined
}
},
computed: {
},
created () {
this.menus = createMenus(this)
},
methods: {
handleClick (e) {

View File

@ -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
}