美化布局和嵌套路由 day3

2019-07-22  本文已影响0人  zheng_zq
美化页面
.layout-logo{
    color: #ffffff;
    line-height: 30px;
    font-size: 20px;
    height: 30px;    
    border-radius: 3px;
    float: left;
    position: relative;
    top: 15px;
    left: 20px;
}

效果如图:


image.png
<Breadcrumb :style="{margin: '24px 0'}">
            <BreadcrumbItem>Home</BreadcrumbItem>
            <BreadcrumbItem>Components</BreadcrumbItem>
            <BreadcrumbItem>Layout</BreadcrumbItem>
          </Breadcrumb>
          <Content :style="{padding: '24px', minHeight: '280px', background: '#fff'}">Content</Content>

效果如图:


image.png
 <MenuItem name="0">
              <Icon type="ios-navigate"></Icon>工作区域
            </MenuItem>
            <Submenu name="1">
              <template slot="title">
                <Icon type="ios-navigate"></Icon>用户管理
              </template>
              <MenuItem name="1-1" to="/userlist">用户列表</MenuItem>
              <MenuItem name="1-2">用户统计</MenuItem>
            </Submenu>

效果如图:


image.png
嵌套路由
import Vue from 'vue'
import Router from 'vue-router'
import Test01 from '@/views/Test01'
import userlist from '@/views/user/userlist'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Test01',
      component: Test01,

      children: [
        {
          path: 'userlist',
          name: 'userlist',
          component: userlist
        }
      ]
    }
  ]
})
登录页面
<template>
    <button @click="login">登录</button>
</template>

<script>
// 跳转到主页面
export default {
    methods:{
        login(){
            this.$router.push("/")
        }
    }
}
</script>

<style>

</style>
import Vue from 'vue'
import Router from 'vue-router'
import Test01 from '@/views/Test01'
import userlist from '@/views/user/userlist'
import login from '@/views/login/login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/',
      name: 'Test01',
      component: Test01,

      children: [
        {
          path: 'userlist',
          name: 'userlist',
          component: userlist
        }
      ]
    }
  ]
})
上一篇下一篇

猜你喜欢

热点阅读