-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 85adc27
Showing
14 changed files
with
414 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# backend | ||
|
||
## Project setup | ||
``` | ||
npm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
npm run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
npm run lint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/app' | ||
], | ||
plugins: [ | ||
[ | ||
"component", | ||
{ | ||
"libraryName": "element-ui", | ||
"styleLibraryName": "theme-chalk" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "backend", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"element-ui": "^2.4.6", | ||
"vue": "^2.5.17", | ||
"vue-router": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "^3.0.1", | ||
"@vue/cli-plugin-eslint": "^3.0.1", | ||
"@vue/cli-service": "^3.0.1", | ||
"babel-plugin-component": "^1.1.1", | ||
"node-sass": "^4.9.3", | ||
"sass-loader": "^7.1.0", | ||
"vue-template-compiler": "^2.5.17" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"rules": {}, | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
} | ||
}, | ||
"postcss": { | ||
"plugins": { | ||
"autoprefixer": {} | ||
} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions", | ||
"not ie <= 8" | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title>小小胡的Backend</title> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but backend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<router-view></router-view> | ||
</template> | ||
<script> | ||
export default { | ||
name: 'app' | ||
} | ||
</script> | ||
|
||
<style> | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
html, body { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
#app { | ||
font-family: 'Avenir', Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<li> | ||
<span @click="toggle(model.menuName,model.menuUrl,model.menuPath)"> | ||
<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> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Menu", | ||
data() { | ||
return { | ||
open: false, | ||
} | ||
}, | ||
props: ['model'], | ||
computed: { | ||
isFolder() { | ||
return this.model.childMenus && this.model.childMenus.length | ||
} | ||
}, | ||
methods: { | ||
toggle(msg,menuUrl,menuPath) { | ||
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; | ||
color: #fff; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<template> | ||
<div class="slider"> | ||
<div class="silder-header"></div> | ||
<div class="slider-list"> | ||
<ul v-for="menuItem in theModel"> | ||
<Menu :model="menuItem"></Menu> | ||
</ul> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Menu from "./Menu.vue"; | ||
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: [] | ||
} | ||
] | ||
}; | ||
}, | ||
components: { | ||
Menu: Menu | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped lang='scss'> | ||
.slider { | ||
width: 256px; | ||
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; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
import router from './router/router' | ||
import ElementUI from 'element-ui' | ||
import 'element-ui/lib/theme-chalk/index.css' | ||
|
||
Vue.use(ElementUI); | ||
Vue.config.productionTip = false | ||
|
||
new Vue({ | ||
el: '#app', | ||
router, | ||
render: h => h(App) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<div class="home"> | ||
<Slider></Slider> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Slider from './../../components/Slider/Slider.vue' | ||
export default { | ||
name: 'Home', | ||
components: { | ||
Slider: Slider | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.home { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> |
Oops, something went wrong.