zoukankan      html  css  js  c++  java
  • Vue -- 后台系统布局导航栏

    <template>
      <div class="home">
        <div class="head">
          <span>vue-demo</span>
          <Menu class="menu" mode="horizontal" :theme="theme1" 
          :active-name="$route.path" @on-select="onSelect">
            <MenuItem name="/Chart" :class="$route.path == '/Chart'?'on':''">统计图</MenuItem>
            <MenuItem name="/File" :class="$route.path == '/File'?'on':''">数据</MenuItem>
            <MenuItem name="/Download" :class="$route.path == '/Download'?'on':''">视频</MenuItem>
            <Submenu  name="/Other">
              <template slot="title">
                  其他
              </template>
              <MenuItem name="/o1">邮件</MenuItem>
              <MenuItem name="/o2">依赖</MenuItem>
              <MenuItem name="/o3">源码</MenuItem>
            </Submenu>
         </Menu>
        </div>
        <router-view></router-view>
      </div>
    </template>
    <script>
    export default {
      data(){
        return{
          theme1: 'dark',
        }
      },
      methods:{
        //  导航切换
        onSelect(name){
          this.$router.push(name)
        }
      }
    };
    </script>
    <style scoped>
    .head{ 100%;height: 50px;background: #293c55;display: flex;}
    .head span{margin-left: 25px;;color:#fff;line-height: 50px;}
    .menu{height: 50px;margin-left: 50px;background: #293c55;line-height: 48px;}
    .on{border-bottom: 2px solid #2db7f5;color:#2db7f5!important;}
    </style>
  • 相关阅读:
    perl学习之路3
    perl学习之路1
    年少的忧伤
    莎士比亚的情诗
    自做贪吃蛇游戏的android实现
    伤感的蝴蝶
    爱上下拉列表框Spinner
    相识RadioGroup初恋CheckBox
    EditText和Button的纠缠
    谁陪我一起打包Andriod应用
  • 原文地址:https://www.cnblogs.com/q0024/p/14115574.html
Copyright © 2011-2022 走看看