vue 滚动条scrollbar 使用

隆睿
2023-12-01
<el-scrollbar></el-scrollbar>
    <el-scrollbar style='height:100%'>
      <ul>
        <li v-for="(item, index) in menu" :key="item.code" v-bind:class="{active: isActive(item,index), show: toggleMenu[index]}" >
          <div class='title'  v-on:click="changeMenu(index,item.url)"><i :class="`vankeicon${index+1}`"></i>{{item.name}}<span v-if='item.subMenus'></span></div>
          <ul :style="{'height':toggleMenu[index] ? `${item.subMenus.length*45}px` : 0 }" v-if='item.subMenus'>
            <li v-for="sub in item.subMenus" :key="sub.funtCd" v-bind:class="{ active: isSubActive(sub.url,sub.funtCd) }">
              <router-link :to="sub.url">{{sub.name}}<div v-b-tooltip.html.bottomleft :title="meunTips.get(sub.name)"  class="x-text"  v-if='meunTips.get(sub.name)'>
                <img src="../../assets/images/prompt.png" alt=""></div>
              </router-link>
            </li>
          </ul>
        </li>
      </ul>
    </el-scrollbar>

 

 类似资料: