pull/165/head
tangjinzhou 7 years ago
parent d73442a0ac
commit 3035b83e15

@ -1,6 +1,7 @@
<script> <script>
import { Menu } from 'antd' import { Menu } from 'antd'
import * as AllDemo from '../demo' import * as AllDemo from '../demo'
import Header from './header'
const MenuItem = Menu.Item const MenuItem = Menu.Item
export default { export default {
render () { render () {
@ -11,14 +12,17 @@ export default {
lang = 'us' lang = 'us'
} }
return ( return (
<div class='site page-container'> <div class='site'>
<Menu class='nav' selectedKeys={[name]}> <Header />
{Object.keys(AllDemo).map(d => <MenuItem key={d}> <div class='main-wrapper'>
<router-link to={{ path: `/components/${lang}/${d}` }}>{d}</router-link> <Menu class='nav' selectedKeys={[name]}>
</MenuItem>)} {Object.keys(AllDemo).map(d => <MenuItem key={d}>
</Menu> <router-link to={{ path: `/components/${lang}/${d}` }}>{d}</router-link>
<div class='content main-container'> </MenuItem>)}
{Demo ? <Demo /> : '正在紧急开发中...'} </Menu>
<div class='content main-container'>
{Demo ? <Demo /> : '正在紧急开发中...'}
</div>
</div> </div>
</div> </div>

@ -0,0 +1,24 @@
<template>
<header id='header'>
<a-menu v-model="current" mode="horizontal" id="nav">
<a-menu-item key='home'>
首页
</a-menu-item>
<a-menu-item key='design'>
设计语言
</a-menu-item>
<a-menu-item key='components'>
组件
</a-menu-item>
</a-menu>
</header>
</template>
<script>
export default {
data () {
return {
current: ['components'],
}
},
}
</script>

@ -1,11 +1,25 @@
@import './theme/static/index.less'; @import './theme/static/index.less';
#app {
height: 100%;
}
.site { .site {
display: flex; display: flex;
flex-direction: column;
height: 100%;
.nav { .nav {
width: 200px; width: 200px;
overflow-y: scroll;
} }
.content { .content {
flex: 1; flex: 1;
overflow-y: scroll;
}
#header {
padding: 0 50px;
}
.main-wrapper {
display: flex;
flex: 1;
} }
} }

Loading…
Cancel
Save