中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

如何使用Element NavMenu導航菜單

發布時間:2020-07-27 13:53:23 來源:億速云 閱讀:507 作者:小豬 欄目:開發技術

這篇文章主要講解了如何使用Element NavMenu導航菜單,內容清晰明了,對此有興趣的小伙伴可以學習一下,相信大家閱讀完之后會有幫助。

組件—導航菜單

頂欄

如何使用Element NavMenu導航菜單

<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
 <el-menu-item index="1">處理中心</el-menu-item>
 <el-submenu index="2">
  <template slot="title">我的工作臺</template>
  <el-menu-item index="2-1">選項1</el-menu-item>
  <el-menu-item index="2-2">選項2</el-menu-item>
  <el-menu-item index="2-3">選項3</el-menu-item>
  <el-submenu index="2-4">
   <template slot="title">選項4</template>
   <el-menu-item index="2-4-1">選項1</el-menu-item>
   <el-menu-item index="2-4-2">選項2</el-menu-item>
   <el-menu-item index="2-4-3">選項3</el-menu-item>
  </el-submenu>
 </el-submenu>
 <el-menu-item index="3" disabled>消息中心</el-menu-item>
 <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">訂單管理</a></el-menu-item>
</el-menu>
<div class="line"></div>
<el-menu
 :default-active="activeIndex2"
 class="el-menu-demo"
 mode="horizontal"
 @select="handleSelect"
 background-color="#545c64"
 text-color="#fff"
 active-text-color="#ffd04b">
 <el-menu-item index="1">處理中心</el-menu-item>
 <el-submenu index="2">
  <template slot="title">我的工作臺</template>
  <el-menu-item index="2-1">選項1</el-menu-item>
  <el-menu-item index="2-2">選項2</el-menu-item>
  <el-menu-item index="2-3">選項3</el-menu-item>
  <el-submenu index="2-4">
   <template slot="title">選項4</template>
   <el-menu-item index="2-4-1">選項1</el-menu-item>
   <el-menu-item index="2-4-2">選項2</el-menu-item>
   <el-menu-item index="2-4-3">選項3</el-menu-item>
  </el-submenu>
 </el-submenu>
 <el-menu-item index="3" disabled>消息中心</el-menu-item>
 <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">訂單管理</a></el-menu-item>
</el-menu>

<script>
 export default {
  data() {
   return {
    activeIndex: '1',
    activeIndex2: '1'
   };
  },
  methods: {
   handleSelect(key, keyPath) {
    console.log(key, keyPath);
   }
  }
 }
</script>

側欄

如何使用Element NavMenu導航菜單

<el-row class="tac">
 <el-col :span="12">
  <h6>默認顏色</h6>
  <el-menu
   default-active="2"
   class="el-menu-vertical-demo"
   @open="handleOpen"
   @close="handleClose">
   <el-submenu index="1">
    <template slot="title">
     <i class="el-icon-location"></i>
     <span>導航一</span>
    </template>
    <el-menu-item-group>
     <template slot="title">分組一</template>
     <el-menu-item index="1-1">選項1</el-menu-item>
     <el-menu-item index="1-2">選項2</el-menu-item>
    </el-menu-item-group>
    <el-menu-item-group title="分組2">
     <el-menu-item index="1-3">選項3</el-menu-item>
    </el-menu-item-group>
    <el-submenu index="1-4">
     <template slot="title">選項4</template>
     <el-menu-item index="1-4-1">選項1</el-menu-item>
    </el-submenu>
   </el-submenu>
   <el-menu-item index="2">
    <i class="el-icon-menu"></i>
    <span slot="title">導航二</span>
   </el-menu-item>
   <el-menu-item index="3" disabled>
    <i class="el-icon-document"></i>
    <span slot="title">導航三</span>
   </el-menu-item>
   <el-menu-item index="4">
    <i class="el-icon-setting"></i>
    <span slot="title">導航四</span>
   </el-menu-item>
  </el-menu>
 </el-col>
 <el-col :span="12">
  <h6>自定義顏色</h6>
  <el-menu
   default-active="2"
   class="el-menu-vertical-demo"
   @open="handleOpen"
   @close="handleClose"
   background-color="#545c64"
   text-color="#fff"
   active-text-color="#ffd04b">
   <el-submenu index="1">
    <template slot="title">
     <i class="el-icon-location"></i>
     <span>導航一</span>
    </template>
    <el-menu-item-group>
     <template slot="title">分組一</template>
     <el-menu-item index="1-1">選項1</el-menu-item>
     <el-menu-item index="1-2">選項2</el-menu-item>
    </el-menu-item-group>
    <el-menu-item-group title="分組2">
     <el-menu-item index="1-3">選項3</el-menu-item>
    </el-menu-item-group>
    <el-submenu index="1-4">
     <template slot="title">選項4</template>
     <el-menu-item index="1-4-1">選項1</el-menu-item>
    </el-submenu>
   </el-submenu>
   <el-menu-item index="2">
    <i class="el-icon-menu"></i>
    <span slot="title">導航二</span>
   </el-menu-item>
   <el-menu-item index="3" disabled>
    <i class="el-icon-document"></i>
    <span slot="title">導航三</span>
   </el-menu-item>
   <el-menu-item index="4">
    <i class="el-icon-setting"></i>
    <span slot="title">導航四</span>
   </el-menu-item>
  </el-menu>
 </el-col>
</el-row>

<script>
 export default {
  methods: {
   handleOpen(key, keyPath) {
    console.log(key, keyPath);
   },
   handleClose(key, keyPath) {
    console.log(key, keyPath);
   }
  }
 }
</script>

折疊

如何使用Element NavMenu導航菜單

<el-radio-group v-model="isCollapse" >
 <el-radio-button :label="false">展開</el-radio-button>
 <el-radio-button :label="true">收起</el-radio-button>
</el-radio-group>
<el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
 <el-submenu index="1">
  <template slot="title">
   <i class="el-icon-location"></i>
   <span slot="title">導航一</span>
  </template>
  <el-menu-item-group>
   <span slot="title">分組一</span>
   <el-menu-item index="1-1">選項1</el-menu-item>
   <el-menu-item index="1-2">選項2</el-menu-item>
  </el-menu-item-group>
  <el-menu-item-group title="分組2">
   <el-menu-item index="1-3">選項3</el-menu-item>
  </el-menu-item-group>
  <el-submenu index="1-4">
   <span slot="title">選項4</span>
   <el-menu-item index="1-4-1">選項1</el-menu-item>
  </el-submenu>
 </el-submenu>
 <el-menu-item index="2">
  <i class="el-icon-menu"></i>
  <span slot="title">導航二</span>
 </el-menu-item>
 <el-menu-item index="3" disabled>
  <i class="el-icon-document"></i>
  <span slot="title">導航三</span>
 </el-menu-item>
 <el-menu-item index="4">
  <i class="el-icon-setting"></i>
  <span slot="title">導航四</span>
 </el-menu-item>
</el-menu>

<style>
 .el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
 }
</style>

<script>
 export default {
  data() {
   return {
    isCollapse: true
   };
  },
  methods: {
   handleOpen(key, keyPath) {
    console.log(key, keyPath);
   },
   handleClose(key, keyPath) {
    console.log(key, keyPath);
   }
  }
 }
</script>

Menu Attribute

如何使用Element NavMenu導航菜單

如何使用Element NavMenu導航菜單

Menu Methods

如何使用Element NavMenu導航菜單

Menu Events

如何使用Element NavMenu導航菜單

SubMenu Attribute

如何使用Element NavMenu導航菜單

Menu-Item Attribute

如何使用Element NavMenu導航菜單

Menu-Group Attribute

如何使用Element NavMenu導航菜單

看完上述內容,是不是對如何使用Element NavMenu導航菜單有進一步的了解,如果還想學習更多內容,歡迎關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

同德县| 连云港市| 彭泽县| 班戈县| 田林县| 四川省| 昔阳县| 儋州市| 阜新市| 蓝田县| 友谊县| 黄平县| 偏关县| 泌阳县| 渝北区| 西贡区| 阳新县| 黄冈市| 梧州市| 麻江县| 亚东县| 敦煌市| 晋宁县| 云霄县| 太湖县| 如东县| 开鲁县| 盐津县| 贞丰县| 临海市| 莫力| 清远市| 开平市| 廊坊市| 布尔津县| 岐山县| 绥中县| 上林县| 塔城市| 邹城市| 奎屯市|