Commit 531cca58 authored by fangzhipeng's avatar fangzhipeng

提交vue管理平台代码

parent 8b37157c
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>bigsys-auth</title> <title>bigsys-auth</title>
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -6108,6 +6108,11 @@ ...@@ -6108,6 +6108,11 @@
"integrity": "sha1-Inh95ON+vZM5t0IjvEZ9Gt7jBUU=", "integrity": "sha1-Inh95ON+vZM5t0IjvEZ9Gt7jBUU=",
"dev": true "dev": true
}, },
"vuex": {
"version": "2.4.0",
"resolved": "http://registry.npm.taobao.org/vuex/download/vuex-2.4.0.tgz",
"integrity": "sha1-4dBDBkYoK0AAf90G7Groip9aHhQ="
},
"watchpack": { "watchpack": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "http://registry.npm.taobao.org/watchpack/download/watchpack-1.4.0.tgz", "resolved": "http://registry.npm.taobao.org/watchpack/download/watchpack-1.4.0.tgz",
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
"axios": "^0.16.2", "axios": "^0.16.2",
"element-ui": "^1.4.3", "element-ui": "^1.4.3",
"vue": "^2.4.2", "vue": "^2.4.2",
"vue-router": "^2.7.0" "vue-router": "^2.7.0",
"vuex": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.2", "autoprefixer": "^7.1.2",
......
<template> <template>
<div id="app"> <div id="app">
<img src="./assets/logo.png">
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
...@@ -13,11 +12,8 @@ export default { ...@@ -13,11 +12,8 @@ export default {
<style> <style>
#app { #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif; position: relative;
-webkit-font-smoothing: antialiased; height: 100%;
-moz-osx-font-smoothing: grayscale; width: 100%;
text-align: center;
color: #2c3e50;
margin-top: 60px;
} }
</style> </style>
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
</template> </template>
<script> <script>
import axios from 'axios' // import axios from 'axios'
export default { export default {
name: 'hello', name: 'hello',
mounted: function () { mounted: function () {
axios.get('/api/test') // axios.get('/api/test')
.then(res => { // .then(res => {
console.log(res.data) // console.log(res.data)
}) // })
}, },
data () { data () {
return { return {
......
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import ElementUI from 'element-ui'
import store from './store'
import 'element-ui/lib/theme-default/index.css'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI)
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
store,
template: '<App/>', template: '<App/>',
components: { App } components: { App }
}) })
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import Hello from '@/components/Hello' // in development env not use Lazy Loading,because Lazy Loading too many pages will cause webpack hot update too slow.so only in production use Lazy Loading
Vue.use(Router) Vue.use(Router)
export default new Router({ /* layout */
routes: [ import Layout from '../views/layout/Layout'
import Login from '../views/Login'
/**
* icon : the icon show in the sidebar
* hidden : if `hidden:true` will not show in the sidebar
* redirect : if `redirect:noredirect` will no redirct in the levelbar
* noDropdown : if `noDropdown:true` will has no submenu
* meta : { role: ['admin'] } will control the page role
**/
export const constantRouterMap = [
{ {
path: '/main',
component: Layout,
name: '主页'
}, {
path: '/', path: '/',
name: 'Hello', component: Login,
component: Hello name: '登录'
} }
] ]
export default new Router({
// mode: 'history', //后端支持可开
routes: constantRouterMap
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment