国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

ElementUI淺嘗輒止32:NavMenu 導(dǎo)航菜單

這篇具有很好參考價(jià)值的文章主要介紹了ElementUI淺嘗輒止32:NavMenu 導(dǎo)航菜單。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

為網(wǎng)站提供導(dǎo)航功能的菜單。常用于網(wǎng)站平臺頂部或側(cè)邊欄菜單導(dǎo)航。

1.如何使用?頂欄

/*導(dǎo)航菜單默認(rèn)為垂直模式,通過mode屬性可以使導(dǎo)航菜單變更為水平模式。另外,在菜單中通過submenu組件可以生成二級菜單。Menu 還提供了background-color、text-color和active-text-color,分別用于設(shè)置菜單的背景色、菜單的文字顏色和當(dāng)前激活菜單的文字顏色。*/

<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">選項(xiàng)1</el-menu-item>
    <el-menu-item index="2-2">選項(xiàng)2</el-menu-item>
    <el-menu-item index="2-3">選項(xiàng)3</el-menu-item>
    <el-submenu index="2-4">
      <template slot="title">選項(xiàng)4</template>
      <el-menu-item index="2-4-1">選項(xiàng)1</el-menu-item>
      <el-menu-item index="2-4-2">選項(xiàng)2</el-menu-item>
      <el-menu-item index="2-4-3">選項(xiàng)3</el-menu-item>
    </el-submenu>
  </el-submenu>
  <el-menu-item index="3" disabled>消息中心</el-menu-item>
  <el-menu-item index="4"><a  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">選項(xiàng)1</el-menu-item>
    <el-menu-item index="2-2">選項(xiàng)2</el-menu-item>
    <el-menu-item index="2-3">選項(xiàng)3</el-menu-item>
    <el-submenu index="2-4">
      <template slot="title">選項(xiàng)4</template>
      <el-menu-item index="2-4-1">選項(xiàng)1</el-menu-item>
      <el-menu-item index="2-4-2">選項(xiàng)2</el-menu-item>
      <el-menu-item index="2-4-3">選項(xiàng)3</el-menu-item>
    </el-submenu>
  </el-submenu>
  <el-menu-item index="3" disabled>消息中心</el-menu-item>
  <el-menu-item index="4"><a  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>

2.側(cè)欄

垂直菜單,可內(nèi)嵌子菜單。文章來源地址http://www.zghlxwxcb.cn/news/detail-697885.html

//通過el-menu-item-group組件可以實(shí)現(xiàn)菜單進(jìn)行分組,分組名可以通過title屬性直接設(shè)定,也可以通過具名 slot 來設(shè)定。

<el-row class="tac">
  <el-col :span="12">
    <h5>默認(rèn)顏色</h5>
    <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>導(dǎo)航一</span>
        </template>
        <el-menu-item-group>
          <template slot="title">分組一</template>
          <el-menu-item index="1-1">選項(xiàng)1</el-menu-item>
          <el-menu-item index="1-2">選項(xiàng)2</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group title="分組2">
          <el-menu-item index="1-3">選項(xiàng)3</el-menu-item>
        </el-menu-item-group>
        <el-submenu index="1-4">
          <template slot="title">選項(xiàng)4</template>
          <el-menu-item index="1-4-1">選項(xiàng)1</el-menu-item>
        </el-submenu>
      </el-submenu>
      <el-menu-item index="2">
        <i class="el-icon-menu"></i>
        <span slot="title">導(dǎo)航二</span>
      </el-menu-item>
      <el-menu-item index="3" disabled>
        <i class="el-icon-document"></i>
        <span slot="title">導(dǎo)航三</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title">導(dǎo)航四</span>
      </el-menu-item>
    </el-menu>
  </el-col>
  <el-col :span="12">
    <h5>自定義顏色</h5>
    <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>導(dǎo)航一</span>
        </template>
        <el-menu-item-group>
          <template slot="title">分組一</template>
          <el-menu-item index="1-1">選項(xiàng)1</el-menu-item>
          <el-menu-item index="1-2">選項(xiàng)2</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group title="分組2">
          <el-menu-item index="1-3">選項(xiàng)3</el-menu-item>
        </el-menu-item-group>
        <el-submenu index="1-4">
          <template slot="title">選項(xiàng)4</template>
          <el-menu-item index="1-4-1">選項(xiàng)1</el-menu-item>
        </el-submenu>
      </el-submenu>
      <el-menu-item index="2">
        <i class="el-icon-menu"></i>
        <span slot="title">導(dǎo)航二</span>
      </el-menu-item>
      <el-menu-item index="3" disabled>
        <i class="el-icon-document"></i>
        <span slot="title">導(dǎo)航三</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title">導(dǎo)航四</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>

?3.展開折疊

<el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
  <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">導(dǎo)航一</span>
    </template>
    <el-menu-item-group>
      <span slot="title">分組一</span>
      <el-menu-item index="1-1">選項(xiàng)1</el-menu-item>
      <el-menu-item index="1-2">選項(xiàng)2</el-menu-item>
    </el-menu-item-group>
    <el-menu-item-group title="分組2">
      <el-menu-item index="1-3">選項(xiàng)3</el-menu-item>
    </el-menu-item-group>
    <el-submenu index="1-4">
      <span slot="title">選項(xiàng)4</span>
      <el-menu-item index="1-4-1">選項(xiàng)1</el-menu-item>
    </el-submenu>
  </el-submenu>
  <el-menu-item index="2">
    <i class="el-icon-menu"></i>
    <span slot="title">導(dǎo)航二</span>
  </el-menu-item>
  <el-menu-item index="3" disabled>
    <i class="el-icon-document"></i>
    <span slot="title">導(dǎo)航三</span>
  </el-menu-item>
  <el-menu-item index="4">
    <i class="el-icon-setting"></i>
    <span slot="title">導(dǎo)航四</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>

到了這里,關(guān)于ElementUI淺嘗輒止32:NavMenu 導(dǎo)航菜單的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • ElementUI淺嘗輒止18:Avatar 頭像

    用圖標(biāo)、圖片或者字符的形式展示用戶或事物信息。 常用于管理系統(tǒng)或web網(wǎng)站的用戶頭像,在用戶賬戶模塊更換頭像操作也能看到關(guān)于Avatar組件的應(yīng)用。 通過? shape ?和? size ?設(shè)置頭像的形狀和大小。 支持三種類型:圖標(biāo)、圖片和字符 當(dāng)展示類型為圖片的時(shí)候,圖片加載失

    2024年02月09日
    瀏覽(19)
  • ElementUI淺嘗輒止22:Alert 警告

    常見于消息提示或警告框。 頁面中的非浮層元素,不會(huì)自動(dòng)消失。 Alert 組件提供了兩個(gè)不同的主題: light 和 dark 。 自定義關(guān)閉按鈕為文字或其他符號。 表示某種狀態(tài)時(shí)提升可讀性。 使用? center ?屬性讓文字水平居中 包含標(biāo)題和內(nèi)容,解釋更詳細(xì)的警告。 ?

    2024年02月09日
    瀏覽(22)
  • ElementUI淺嘗輒止38:Upload 上傳

    通過點(diǎn)擊或者拖拽上傳文件實(shí)現(xiàn)上傳功能,常見于文件、文件夾或圖片上傳,使用挺頻繁的。需要熟練掌握 通過 slot 你可以傳入自定義的上傳按鈕類型和文字提示。可通過設(shè)置 limit 和 on-exceed 來限制上傳文件的個(gè)數(shù)和定義超出限制時(shí)的行為。可通過設(shè)置 before-remove 來阻止文件

    2024年02月09日
    瀏覽(17)
  • ElementUI淺嘗輒止16:Tag 標(biāo)簽

    用于標(biāo)記和選擇。 動(dòng)態(tài)編輯標(biāo)簽可以通過點(diǎn)擊標(biāo)簽關(guān)閉按鈕后觸發(fā)的? close ?事件來實(shí)現(xiàn) Tag 組件提供除了默認(rèn)值以外的三種尺寸,可以在不同場景下選擇合適的按鈕尺寸。 Tag 組件提供了三個(gè)不同的主題: dark 、 light ?和? plain ?

    2024年02月10日
    瀏覽(23)
  • ElementUI淺嘗輒止26:Notification 通知

    懸浮出現(xiàn)在頁面角落,顯示全局的通知提醒消息。 適用性廣泛的通知欄 帶有 icon,常用來顯示「成功、警告、消息、錯(cuò)誤」類的系統(tǒng)消息 可以讓 Notification 從屏幕四角中的任意一角彈出 使用 position 屬性定義 Notification 的彈出位置,支持四個(gè)選項(xiàng): top-right 、 top-left 、 bottom

    2024年02月09日
    瀏覽(15)
  • ElementUI淺嘗輒止33:Form 表單

    包括各種表單項(xiàng),比如輸入框、選擇器、開關(guān)、單選框、多選框等。 W3C 標(biāo)準(zhǔn)中有如下規(guī)定: When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form. 即:當(dāng)一個(gè) form 元素中只有一個(gè)輸入框時(shí),在該輸入框中按下回車應(yīng)提交

    2024年02月09日
    瀏覽(29)
  • ElementUI淺嘗輒止15:Table 表格

    用于展示多條結(jié)構(gòu)類似的數(shù)據(jù),可對數(shù)據(jù)進(jìn)行排序、篩選、對比或其他自定義操作。 Table組件比較常用,常見于數(shù)據(jù)查詢,報(bào)表頁面,用來展示表格數(shù)據(jù)。 使用帶斑馬紋的表格,可以更容易區(qū)分出不同行的數(shù)據(jù)。 可將表格內(nèi)容 highlight 顯示,方便區(qū)分「成功、信息、警告、危

    2024年02月09日
    瀏覽(21)
  • ElementUI淺嘗輒止36:Input 輸入框

    通過鼠標(biāo)或鍵盤輸入字符 Input 為受控組件,它 總會(huì)顯示 Vue 綁定值 。 通常情況下,應(yīng)當(dāng)處理? input ?事件,并更新組件的綁定值(或使用 v-model )。否則,輸入框內(nèi)顯示的值將不會(huì)改變。不支持? v-model ?修飾符。 通過? disabled ?屬性指定是否禁用 input 組件 使用 clearable 屬性

    2024年02月09日
    瀏覽(20)
  • ElementUI淺嘗輒止27:Steps 步驟條

    引導(dǎo)用戶按照流程完成任務(wù)的分步導(dǎo)航條,可根據(jù)實(shí)際應(yīng)用場景設(shè)定步驟,步驟不得少于 2 步。 設(shè)置 active 屬性,接受一個(gè) Number ,表明步驟的 index,從 0 開始。需要定寬的步驟條時(shí),設(shè)置 space 屬性即可,它接受 Number ,單位為 px ,如果不設(shè)置,則為自適應(yīng)。設(shè)置 finish-stat

    2024年02月09日
    瀏覽(21)
  • ElementUI淺嘗輒止29:Breadcrumb 面包屑

    顯示當(dāng)前頁面的路徑,快速返回之前的任意頁面。 在 el-breadcrumb 中使用 el-breadcrumb-item 標(biāo)簽表示從首頁開始的每一級。Element 提供了一個(gè) separator 屬性,在 el-breadcrumb 標(biāo)簽中設(shè)置它來決定分隔符,它只能是字符串,默認(rèn)為斜杠 / 。 通過設(shè)置? separator-class ?可使用相應(yīng)的? icon

    2024年02月09日
    瀏覽(18)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包