Skip to content

Commit

Permalink
backend
Browse files Browse the repository at this point in the history
  • Loading branch information
frontHu committed Sep 4, 2018
2 parents cbe75b3 + 70d5a2c commit 88a9bf1
Show file tree
Hide file tree
Showing 16 changed files with 13,813 additions and 68 deletions.
13,480 changes: 13,480 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"dependencies": {
"element-ui": "^2.4.6",
"highlight.js": "^9.12.0",
"marked": "^0.5.0",
"simplemde": "^1.11.2",
"vue": "^2.5.17",
"vue-router": "^3.0.1"
},
Expand Down
92 changes: 92 additions & 0 deletions src/assets/css/atom-one-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
Atom One Dark by Daniel Gamage
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
base: #282c34
mono-1: #abb2bf
mono-2: #818896
mono-3: #5c6370
hue-1: #56b6c2
hue-2: #61aeee
hue-3: #c678dd
hue-4: #98c379
hue-5: #e06c75
hue-5-2: #be5046
hue-6: #d19a66
hue-6-2: #e6c07b
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #abb2bf;
background: #282c34;
}

.hljs-comment,
.hljs-quote {
color: #5c6370;
font-style: italic;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula {
color: #c678dd;
}

.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
color: #e06c75;
}

.hljs-literal {
color: #56b6c2;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
color: #98c379;
}

.hljs-built_in,
.hljs-class .hljs-title {
color: #e6c07b;
}

.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
color: #d19a66;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
color: #61aeee;
}

.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}

.hljs-link {
text-decoration: underline;
}
7 changes: 7 additions & 0 deletions src/assets/css/simplemde.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added src/assets/icon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icon2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icon2-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/桃子.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 50 additions & 20 deletions src/components/Slider/Menu.vue
Original file line number Diff line number Diff line change
@@ -1,47 +1,77 @@
<template>
<li>
<span >
<i v-if="!isFolder" class="icon file-text">●</i>
{{ model.menuName }}
<i v-if="isFolder" class="icon" :class="[open ? 'folder-open': 'folder']"></i>
</span>
<ul v-show="open" v-if="isFolder">
<Menu v-for="item in model.childMenus" :model="item" :key="item.menuId"></Menu>
</ul>
</li>
<div>
<li class="menu">
<router-link tag='div' :to="model.link" exact-active-class='menu-active' exact>
<span @click="toggle(model.menuName)" :class="{'menu-son': model.parent === 1}">
<img class="menu-icon" :src="model.icon" alt="">
{{ model.menuName }}
</span>
</router-link>
</li>
<transition name='slide-fade' >
<ul v-show="open" v-if="isFolder">
<Menu v-for="item in model.childMenus" :model="item" :key="item.menuName" :icon="item.icon"></Menu>
</ul>
</transition>
</div>
</template>

<script>
export default {
name: "Menu",
data() {
return {
open: false,
}
open: false
};
},
props: ['model'],
props: ["model", "icon"],
computed: {
isFolder() {
return this.model.childMenus && this.model.childMenus.length
return this.model.childMenus && this.model.childMenus.length;
}
},
methods: {
toggle(msg,menuUrl,menuPath) {
if(this.isFolder) {
this.open = !this.open
toggle() {
if (this.isFolder) {
this.open = !this.open;
}
}
}
}
};
</script>

<style lang='scss' scoped>
.menu {
width: 100%;
height: 46px;
line-height: 46px;
background-color: rgb(67, 74, 80);
padding-left: 20px;
background-color: rgb(84, 92, 100);
color: #fff;
list-style: none;
cursor: pointer;
&:hover {
background-color: rgb(67, 74, 80);
}
.menu-active {
background-color: rgb(67, 74, 80);
}
.menu-son {
margin-left: 20px;
}
.menu-icon {
width: 16px;
height: 16px;
margin-left: 10px;
}
}
.slide-fade-enter-active {
transition: all .3s ease;
}
.slide-fade-leave-active {
transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}
.slide-fade-enter, .slide-fade-leave-to {
opacity: 0;
transform: translateX(-10px);
}
</style>
53 changes: 9 additions & 44 deletions src/components/Slider/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,21 @@
<div class="slider">
<div class="silder-header"></div>
<div class="slider-list">
<ul v-for="menuItem in theModel">
<Menu :model="menuItem"></Menu>
<ul class="slider-item" v-for="(menuItem, index) in theModel" :key="index">
<Menu :model="menuItem" :icon="menuItem.icon" :key="menuItem.id"></Menu>
</ul>
</div>
</div>
</template>

<script>
import Menu from "./Menu.vue";
import menulist from './menulist.js'
export default {
name: "Slider",
data() {
return {
theModel: [
{
id: "1",
menuName: "导航1",
menuCode: "10",
childMenus: [
{
menuName: "用户管理",
menuCode: "11",
childMenus: [
{
menuName: "11111",
menuCode: "12",
childMenus: []
}
]
},
{
menuName: "角色管理",
menuCode: "12",
childMenus: []
},
{
menuName: "菜单管理",
menuCode: "13",
childMenus: []
}
]
},
{
id: "1",
menuName: "导航2",
menuCode: "10",
childMenus: []
}
]
theModel: menulist
};
},
components: {
Expand All @@ -61,20 +27,19 @@ export default {

<style scoped lang='scss'>
.slider {
width: 256px;
width: 100%;
height: 100%;
background-color: rgb(84, 92, 100); //67,74,80
position: fixed;
left: 0;
top: 0;
bottom: 0;
.silder-header {
width: 100%;
height: 64px;
background-color: #002140;
}
.slider-list {
padding: 10px 0;
height: 100%;
.slider-item {
display: block;
}
}
}
</style>
35 changes: 35 additions & 0 deletions src/components/Slider/menulist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export default [
{
id: "1",
menuName: "写一篇文章",
parent: -1,
icon: require('./../../assets/icon1.png'),
link: "/home/markdown",
},
{
id: "2",
menuName: "我的文章库",
parent: -1,
icon: require('./../../assets/icon2.png'),
link: "/home/article",
// childMenus: [{
// id: '2-1',
// menuName: '前端小栈',
// parent: 1,
// icon: require('./../../assets/icon2-1.png'),
// link: "/home/article",
// }, {
// id: '2-2',
// menuName: '其他东东',
// parent: 1,
// icon: require('./../../assets/icon2-2.png'),
// link: "/home/article",
// }]
},{
id: '3',
menuName: '我的草稿箱',
parent: -1,
icon: require('./../../assets/icon2-2.png'),
link: "/home/trash"
}
]
13 changes: 13 additions & 0 deletions src/page/Article/Article.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class="article"></div>
</template>

<script>
export default {
name: 'Article'
}
</script>

<style>
</style>
24 changes: 22 additions & 2 deletions src/page/Home/Home.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div class="home">
<Slider></Slider>
<div class="home-slider">
<Slider></Slider>
</div>
<div class="home-main">
<router-view></router-view>
</div>
</div>
</template>

Expand All @@ -14,9 +19,24 @@
}
</script>

<style scoped>
<style scoped lang='scss'>
.home {
width: 100%;
height: 100%;
.home-slider {
width: 256px;
height: 100%;
background-color: rgb(84, 92, 100); //67,74,80
position: fixed;
left: 0;
top: 0;
bottom: 0;
}
.home-main {
box-sizing: border-box;
width: 100%;
height: 100%;
padding-left: 256px;
}
}
</style>
Loading

0 comments on commit 88a9bf1

Please sign in to comment.