Commit 29c43c72 authored by liumiss's avatar liumiss

set router

parent 005e2c81
<template> <template>
<div id="app"> <div id="app">
<img src="./assets/logo.png"> <router-view name="topbar"/>
<router-view name="sidebar"/>
<router-view/> <router-view/>
</div> </div>
</template> </template>
...@@ -20,4 +21,8 @@ export default { ...@@ -20,4 +21,8 @@ export default {
color: #2c3e50; color: #2c3e50;
margin-top: 60px; margin-top: 60px;
} }
*{
margin: 0;
padding: 0;
}
</style> </style>
<template> <template>
<div class="hello"> <div class="main-container">
<h1>{{ msg }}</h1> main
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div> </div>
</template> </template>
...@@ -88,26 +9,18 @@ export default { ...@@ -88,26 +9,18 @@ export default {
name: 'HelloWorld', name: 'HelloWorld',
data () { data () {
return { return {
msg: 'Welcome to Your Vue.js App'
} }
} }
} }
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped> <style scoped>
h1, h2 { .main-container{
font-weight: normal; position:fixed;
} top:100px;
ul { left:10%;
list-style-type: none; backgroud-color:rgba(0,0,0,0.6);
padding: 0; }
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style> </style>
<template>
<div class="setting-container">
setting
</div>
</template>
<script>
export default {
name: 'Topbar',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style scoped>
.setting-container{
position:fixed;
top:100px;
left:10%;
backgroud-color:rgba(0,0,0,0.6);
}
</style>
\ No newline at end of file
<template>
<div class="setting-container">
setting
</div>
</template>
<script>
export default {
name: 'Topbar',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style scoped>
.setting-container{
position:fixed;
top:100px;
left:10%;
backgroud-color:rgba(0,0,0,0.6);
}
</style>
\ No newline at end of file
<template>
<div class="top-container">
top
</div>
</template>
<script>
export default {
name: 'Topbar',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style scoped>
.top-container{
position: fixed;
top: 0;
width: 100%;
height: 100px;
background-color: rgba(0,0,0,0.5);
}
</style>
\ No newline at end of file
<template>
<div class="setting-container">
setting
</div>
</template>
<script>
export default {
name: 'Topbar',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style scoped>
.setting-container{
position:fixed;
top:100px;
left:10%;
backgroud-color:rgba(0,0,0,0.6);
}
</style>
\ No newline at end of file
<template>
<div class="side-container">
<ul>
<router-link to="/"></router-link>
<router-link to="/tradings">订单</router-link>
<router-link to="/member">会员</router-link>
<router-link to="/setting">设置</router-link>
</ul>
</div>
</template>
<script>
export default {
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style scoped>
.side-container{
position: fixed;
left: 0;
top: 100px;
height: 100%;
width: 10%;
background-color: rgba(0,0,0,0.5)
}
</style>
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld' import HelloWorld from '@/components/HelloWorld'
import Sidebar from '@/components/Sidebar'
import Topbar from '@/components/Topbar'
import Tradings from '@/components/Tradings'
import Member from '@/components/Member'
import Setting from '@/components/Setting'
Vue.use(Router) Vue.use(Router)
export default new Router({ export default new Router({
routes: [ routes: [
{ {
path: '/', path: '/',
name: 'HelloWorld', components: {
component: HelloWorld default:HelloWorld,
sidebar:Sidebar,
topbar:Topbar
}
},
{
path: '/tradings',
component:Tradings
},
{
path: '/member',
component:Member
},
{
path: '/setting',
component:Setting
} }
] ]
}) })
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