免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
成功vue自定義布局

(1)定義布局MainLayout
<template>
  <el-container>
    <el-header>
      <TopMenu style="height: 100%; background-color: rgb(84, 92, 100);" />
    </el-header>
    <el-main style="position: fixed; width: 100%; top: 60px; bottom: 0; left : 0; right: 0">
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
import { TopMenu } from "../components";

export default {
  name: "MainLayout",
  components: {
    TopMenu,
  },
};
</script>

<style lang="scss" scoped>
.el-header {
  padding: 0;
}
</style>
(2)組件頁面TopMenu.vue
<template>
  <div style="background-color: rgb(84, 92, 100);">
    <div class="logo">
      <img style="height: 100%" src="@/assets/404_images/404.png">
    </div>
    <el-menu mode="horizontal" class="topMenu" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
      <el-menu-item index="1" @click="newPatient">新建病歷</el-menu-item>
      <el-menu-item index="2">病歷查詢</el-menu-item>
      <el-menu-item index="3">樣本入庫</el-menu-item>
      <el-menu-item index="4">樣本出庫</el-menu-item>
      <el-menu-item index="5">統(tǒng)計(jì)查詢</el-menu-item>
    </el-menu>
    <el-menu mode="horizontal" class="topActions" background-color="#545c64">
      <el-menu-item>
        <el-input placeholder="搜索患者">
          <el-button slot="append" icon="el-icon-search" />
        </el-input>
      </el-menu-item>
      <el-menu-item>
        <el-dropdown trigger="click">
          <el-button type="text" size="mini" style="color: white">當(dāng)前用戶:{{ name }}<i class="el-icon-arrow-down el-icon--right" /></el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>登出</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'

export default {
  data() {
    return {
    }
  },
  computed: {
    ...mapGetters(['name'])
  },
  mounted() {},
  methods: {
    newPatient() {
      // this.$router.push('/patient/ClinicalFamilySamples/ClinicalFamilySamples_add')
      this.$router.push('/OutHospitalDiagnosisAndTreatmentAdversePregnancyAndChildbirthHistory/index')
    }
  }
}
</script>

<style lang="scss" scoped>
  .logo {
    height: 100%;
    float: left;
    padding: 10px 20px;
  }
  .topMenu {
    float: left;
  }
  .topActions {
    float: right;
  }
</style>
(3)使用MainLayout布局
路由index.js文件
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import MainLayout from '@/layout/main'
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: MainLayout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: { title: '主頁', icon: 'dashboard' },
      hidden: true
    }]
  },
]

/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
export const asyncRoutes = [
  {
    path: '/test_radio',
    name: 'test_radio',
    component: MainLayout,
    children: [
      {
        path: 'index',
        component: () => import('@/views/form/test_radio'),
        name: 'test_radio',
        meta: { title: '測試單選框' }
      }
    ]
  },
  {
    path: '/',
    component: () => import('@/views/nested/menu2/index'),
    meta: { title: 'menu2' },
    hidden: true,
  },

  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
和chatgpt學(xué)架構(gòu)05-首頁開發(fā)
vue 中 elementui Dropdown 下拉菜單中 選項(xiàng)的click事件
Element UI
一個(gè)查詢功能居然被你玩出了花!
Vue 中后臺鑒權(quán)的另一種思路 - 動態(tài)路由的實(shí)現(xiàn)與優(yōu)化
Antdv+Asp.net WebApi開發(fā)學(xué)生信息管理系統(tǒng)(一)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服