最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue elementui簡(jiǎn)易側(cè)拉欄的使用小結(jié)

 更新時(shí)間:2024年06月27日 10:41:37   作者:極端~  
這篇文章主要介紹了vue elementui簡(jiǎn)易側(cè)拉欄的使用,增加了側(cè)拉欄,目的是可以選擇多條數(shù)據(jù)展示數(shù)據(jù),本文通過示例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧

如圖所示,增加了側(cè)拉欄,目的是可以選擇多條數(shù)據(jù)展示數(shù)據(jù)

組件: celadon.vue

<template>
  <div class="LayoutMain">
    <el-aside :width="sidebarIsCollapse ? '180px' : '0px'" class="aside-wrap">
      <template>
        <div
          :class="[
            'aside-wrap-header',
            { 'aside-wrap-header--hide': sidebarIsCollapse },
          ]"
          @click="toggleCollapse"
        ></div>
        <div class="aside-wrap-slot">
          <slot class="btnSlot" name="asideWrapSlot" />
        </div>
      </template>
    </el-aside>
    <div
      class="layout-main-btn"
      :class="['left', { hide: !sidebarIsCollapse }]"
      @click="toggleCollapse"
    >
      <template v-if="sidebarIsCollapse">
        <i class="el-icon-arrow-left" />
      </template>
      <template v-else>
        <i class="el-icon-arrow-right" />
      </template>
    </div>
  </div>
</template>
<script>
export default {
  name: "LayoutMain",
  components: {},
  props: {
    sidebarIsCollapse: {
      type: Boolean,
      default: false,
    },
    menuName: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    toggleCollapse() {
      this.$emit("toggleCollapse");
    },
  },
};
</script>
<style  lang="scss" scoped>
.LayoutMain {
  background: transparent;
  height: 100%;
  width: 100%;
  display: flex;
  ::v-deep .el-main {
    padding: 16px !important;
  }
  .aside-wrap {
    height: 100%;
    background: rgba(67, 133, 219, 0.301);
    transition: width 0.4s;
    .aside-wrap-header {
      display: flex;
    //   height: 48px;
      align-items: center;
      padding: 0 16px;
      font-size: 14px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      cursor: pointer;
      &::v-deep .el-menu::-webkit-scrollbar {
        width: 0 !important;
        -ms-overflow-style: scroll;
        overflow: scroll;
      }
    }
  }
  .layout-main-btn {
    position: absolute;
    top: 40px;
    z-index: 999;
    height: 56px;
    line-height: 54px;
    text-align: center;
    width: 14px;
    border-radius: 10px;
    border: 0.5px solid #ccc;
    background: rgb(27, 118, 238);
    cursor: pointer;
    i {
      color: #e4dada;
      font-size: 14px;
    }
  }
  .left {
    left: 180px;
    transition: left 0.4s;
  }
  .hide {
    left: -5px;
    transition: left 0.4s;
  }
}
</style>

在頁面使用

<!--數(shù)據(jù)分析側(cè)拉欄-->
          <div style="z-index:999; position: absolute;width: 180px;height: 300px;"
          >
            <celadon
              style="
                margin-top: 40px;
                height: 100%;
                width: 100%;
                overflow: scroll;
              "
              :sidebar-is-collapse="sidebarIsCollapse"
              @toggleCollapse="toggleCollapse"
            >
              <div class="select-items" slot="asideWrapSlot">
                <div
                  class="selset-item"
                  v-for="(item, index) in items"
                  :key="index"
                >
                  <input
                    type="checkbox"
                    :id="'checkbox-' + index"
                    v-model="selectedItems"
                    :value="item"
                    @click="selectCheckBox"
                  />
                  <label :for="'checkbox-' + index">{{ item.name }}</label>
                </div>
                <el-button style="margin: 20px 30px" size="small" type="primary"
                  >選擇</el-button
                >
              </div>
            </celadon>
          </div>
          <!--data-->
          items: [
        { name: "1號(hào)設(shè)備", value: "12" },
        { name: "2號(hào)設(shè)備", value: "13" },
        { name: "3號(hào)設(shè)備", value: "4" },
        { name: "3號(hào)設(shè)備", value: "2" },
        { name: "3號(hào)設(shè)備", value: "3" },
        { name: "3號(hào)設(shè)備", value: "1" },
        { name: "3號(hào)設(shè)備", value: "11" },
        { name: "3號(hào)設(shè)備", value: "14" },
        { name: "3號(hào)設(shè)備", value: "15" },
        { name: "3號(hào)設(shè)備", value: "16" },
        { name: "3號(hào)設(shè)備", value: "17" },
        { name: "3號(hào)設(shè)備", value: "33" },
        { name: "3號(hào)設(shè)備", value: "22" },
        { name: "3號(hào)設(shè)備", value: "55" },
        { name: "3號(hào)設(shè)備", value: "66" },
        { name: "3號(hào)設(shè)備", value: "31" },
        { name: "3號(hào)設(shè)備", value: "56" },
        { name: "3號(hào)設(shè)備", value: "45" },
      ],
          <!--methods-->
    selectCheckBox(value){
      console.log(value)
    },
    toggleCollapse() {
      this.sidebarIsCollapse = !this.sidebarIsCollapse;
    },

到此這篇關(guān)于vue elementui簡(jiǎn)易側(cè)拉欄的使用的文章就介紹到這了,更多相關(guān)vue elementui側(cè)拉欄內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Vue集成Iframe頁面的方法示例

    Vue集成Iframe頁面的方法示例

    這篇文章主要介紹了Vue集成Iframe頁面的方法示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-12-12
  • Vue中使用axios調(diào)用后端接口的坑及解決

    Vue中使用axios調(diào)用后端接口的坑及解決

    這篇文章主要介紹了Vue中使用axios調(diào)用后端接口的坑及解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-03-03
  • 關(guān)于Vue開發(fā)中v-if和v-show的聯(lián)合使用步驟

    關(guān)于Vue開發(fā)中v-if和v-show的聯(lián)合使用步驟

    本文探討了在Vue.js項(xiàng)目中如何有效利用v-if和v-show指令來實(shí)現(xiàn)多步驟表單導(dǎo)航,確保用戶操作數(shù)據(jù)能在前后步驟間保持不變,通過具體案例分析了這兩種指令的特點(diǎn)及結(jié)合使用的最佳實(shí)踐,感興趣的朋友跟隨小編一起看看吧
    2025-09-09
  • Vue SSR 即時(shí)編譯技術(shù)的實(shí)現(xiàn)

    Vue SSR 即時(shí)編譯技術(shù)的實(shí)現(xiàn)

    這篇文章主要介紹了Vue SSR 即時(shí)編譯技術(shù)的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-05-05
  • vue中v-bind和v-model的區(qū)別詳解

    vue中v-bind和v-model的區(qū)別詳解

    v-bind和v-model是Vue.js中的兩個(gè)常用指令,它們?cè)诠δ芎陀猛旧嫌幸恍﹨^(qū)別,接下來小編就給大家具有講講vue中v-bind和v-model區(qū)別,感興趣的同學(xué)跟著小編一起來看看吧
    2023-08-08
  • Vue3造輪子之Typescript配置highlight過程

    Vue3造輪子之Typescript配置highlight過程

    這篇文章主要介紹了Vue3造輪子之Typescript配置highlight過程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-07-07
  • Vue之綁定class樣式與style樣式方式

    Vue之綁定class樣式與style樣式方式

    這篇文章主要介紹了Vue之綁定class樣式與style樣式方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-09-09
  • Vue2路由動(dòng)畫效果的實(shí)現(xiàn)代碼

    Vue2路由動(dòng)畫效果的實(shí)現(xiàn)代碼

    本篇文章主要介紹了Vue2路由動(dòng)畫效果的實(shí)現(xiàn)代碼,可以根據(jù)不同的路徑去改變動(dòng)畫的效果,有興趣的可以了解一下
    2017-07-07
  • Vue中的vue-resource示例詳解

    Vue中的vue-resource示例詳解

    Vue與后臺(tái)Api進(jìn)行交互通常是利用vue-resource來實(shí)現(xiàn)的,本質(zhì)上vue-resource是通過http來完成AJAX請(qǐng)求相應(yīng)的。這篇文章主要介紹了Vue中的vue-resource示例詳解,需要的朋友可以參考下
    2018-11-11
  • 淺析Vue 中的 render 函數(shù)

    淺析Vue 中的 render 函數(shù)

    在vue中我們使用模板HTML語法組建頁面的,使用render函數(shù)我們可以用js語言來構(gòu)建DOM,今天小編就通過本文給大家簡(jiǎn)單介紹下Vue 中 render 函數(shù),需要的朋友可以參考下
    2020-02-02

最新評(píng)論

吴堡县| 高阳县| 南宫市| 娄烦县| 绥芬河市| 蓝田县| 葵青区| 镇远县| 赤峰市| 广宗县| 澎湖县| 阜宁县| 南平市| 胶南市| 东光县| 沛县| 阳新县| 文登市| 广水市| 华宁县| 定结县| 富民县| 淮安市| 临潭县| 陕西省| 辉南县| 工布江达县| 和林格尔县| 阿拉善左旗| 金乡县| 黄浦区| 南丹县| 土默特左旗| 贵港市| 东乌珠穆沁旗| 玉树县| 邹平县| 乃东县| 海盐县| 博湖县| 左贡县|