Commit 531cca58 authored by fangzhipeng's avatar fangzhipeng

提交vue管理平台代码

parent 8b37157c
......@@ -3,6 +3,12 @@
<head>
<meta charset="utf-8">
<title>bigsys-auth</title>
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="app"></div>
......
......@@ -6108,6 +6108,11 @@
"integrity": "sha1-Inh95ON+vZM5t0IjvEZ9Gt7jBUU=",
"dev": true
},
"vuex": {
"version": "2.4.0",
"resolved": "http://registry.npm.taobao.org/vuex/download/vuex-2.4.0.tgz",
"integrity": "sha1-4dBDBkYoK0AAf90G7Groip9aHhQ="
},
"watchpack": {
"version": "1.4.0",
"resolved": "http://registry.npm.taobao.org/watchpack/download/watchpack-1.4.0.tgz",
......
......@@ -14,7 +14,8 @@
"axios": "^0.16.2",
"element-ui": "^1.4.3",
"vue": "^2.4.2",
"vue-router": "^2.7.0"
"vue-router": "^2.7.0",
"vuex": "^2.4.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
......
<template>
<div id="app">
<img src="./assets/logo.png">
<router-view></router-view>
</div>
</template>
......@@ -13,11 +12,8 @@ export default {
<style>
#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;
position: relative;
height: 100%;
width: 100%;
}
</style>
......@@ -21,14 +21,14 @@
</template>
<script>
import axios from 'axios'
// import axios from 'axios'
export default {
name: 'hello',
mounted: function () {
axios.get('/api/test')
.then(res => {
console.log(res.data)
})
// axios.get('/api/test')
// .then(res => {
// console.log(res.data)
// })
},
data () {
return {
......
......@@ -3,13 +3,17 @@
import Vue from 'vue'
import App from './App'
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.use(ElementUI)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})
import Vue from 'vue'
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)
/* layout */
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: '/',
component: Login,
name: '登录'
}
]
export default new Router({
routes: [
{
path: '/',
name: 'Hello',
component: Hello
}
]
// 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