當(dāng)使用el-scrollbar的時候,比如你的數(shù)據(jù)列表是后端獲取的,這時候,初始化的時候,因為數(shù)據(jù)還沒有獲取到,導(dǎo)致里面的內(nèi)容沒有撐開,所以滾動條是不顯示的,但是可以正常滾動。
解決方法:
獲取左側(cè)菜單的數(shù)據(jù)時,
<div style=" height: calc(100vh - 120px);over-flow:hidden">
? ? <el-scrollbar style="height: 100%; width: 100%;" ref="scrollbar">
? ? ? <div v-if="validatenull(menu)"
? ? ? ? ? ?class="avue-sidebar--tip">{{$t('menuTip')}}</div>
? ? ? <el-menu unique-opened
? ? ? ? ? ? ? :default-active="nowTagValue"
? ? ? ? ? ? ? mode="vertical"
? ? ? ? ? ? ? :show-timeout="200"
? ? ? ? ? ? ? :collapse="keyCollapse">
? ? ? ? ? ? ? ? ? <sidebar-item :menu="menu"
? ? ? ? ? ? ? ? ? :screen="screen"
? ? ? ? ? ? ? ? ? first
? ? ? ? ? ? ? ? ? :props="website.menu.props"
? ? ? ? ? ? ? ? ? :collapse="keyCollapse"></sidebar-item>
? ? ? </el-menu>
? ? </el-scrollbar>
? ? </div>
//解決滾動條初始化消失的問題--接口請求獲取數(shù)據(jù)時文章來源:http://www.zghlxwxcb.cn/news/detail-484552.html
? ? ? ? ?this.$refs.scrollbar.update()文章來源地址http://www.zghlxwxcb.cn/news/detail-484552.html
到了這里,關(guān)于element-ui el-scrollbar滾動條初始化不顯示的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!