当前位置:网站首页>Use of component El scrollbar
Use of component El scrollbar
2022-07-24 02:07:00 【PS cool tutorial】
Close test effectively !!!
Original link : Components el-scrollbar Use

Use summary : Many conclusions say that we should give el-srollbar Add a specified height , After a long time , The native horizontal scroll bar always appears below it , Bother it , Finally, refer to the blogger's link above , No problem .
Should be :el-scrollbar You should wrap the elements that need to add scroll bars , If the content of the wrapped direct element exceeds the height of the wrapped element , Then a vertical scroll bar will appear .
Whether the horizontal scroll bar appears or not depends on el-scrollbar And the width of the wrapped direct element . And if you want the horizontal scroll bar to display , Need to add .is-horizontal {display: block; } This style .
<template>
<div>
<el-scrollbar class="scrollbar">
<div class="box">
<ul>
<li v-for="item in 100">{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}{
{ item }}</li>
</ul>
</div>
</el-scrollbar>
</div>
</template>
<script>
</script>
<style>
.box {
height: 200px;
}
.scrollbar {
width: 200px;
}
.is-horizontal {
display: block;
}
/deep/ .is-horizontal {
display: none;
}
</style>
combination el-table Examples of use
effect 
Several columns are intentionally copied below ,
Used box Put the box around this form , And set up box The height of the box ( The purpose is to get the vertical scroll bar , Because the height of the data stack of the table is greater than box Altitude time , because el-scrollbar The existence of , Will produce a vertical scroll bar , But at this point , The horizontal scroll bar has not appeared .).
Set up box The width is 1200px( because (180 + 180 + 240 )*2 = 1200), And will el-scrollbar The width of is set to 300, such el-scrollbar The width of is less than box Width , A horizontal scroll bar will be generated
<template>
<div>
<div class="wrapper">
<el-scrollbar class="scrollbar">
<div class="box">
<el-table
class="table1"
:data="tableData">
<el-table-column
prop="date"
label=" date "
width="180">
</el-table-column>
<el-table-column
prop="name"
label=" full name "
width="180">
</el-table-column>
<el-table-column
prop="address"
width="240"
label=" Address ">
</el-table-column>
<el-table-column
prop="date"
label=" date "
width="180">
</el-table-column>
<el-table-column
prop="name"
label=" full name "
width="180">
</el-table-column>
<el-table-column
prop="address"
width="240"
label=" Address ">
</el-table-column>
</el-table>
</div>
</el-scrollbar>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tableData: [{
date: '2016-05-02',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}, {
date: '2016-05-02',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}, {
date: '2016-05-02',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}, {
date: '2016-05-02',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}, {
date: '2016-05-02',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
}, {
date: '2016-05-04',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
}, {
date: '2016-05-01',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
}, {
date: '2016-05-03',
name: ' X.h. ',
address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
}]
}
}
}
</script>
<style>
.box {
height: 300px;
width: 1200px;
}
.scrollbar {
width: 300px;
}
.is-horizontal {
display: block;
}
.wrapper {
width: 300px;
border: 1px solid red;
margin: 20px auto;
}
</style>
边栏推荐
- Hundred million financing events account for more than 30%. Where is the next stop for super automation? -- Manfu Technology
- ASP. Net core write a cache attribute tool
- CANopen communication - PDO and SDO
- 中小型医院基础网络解决方案
- Precautions for using XXL job
- Sword finger offer II 031. Least recently used cache
- About rapidssl certificate
- Database paradigm and schema decomposition
- 2022-07-22: what is the output of the following go language code? A:1; B:1.5; C: Compilation error; D:1.49。 package main import “fmt“ func main() { var i
- LiteSpeed Web服务器中安装SSL证书
猜你喜欢

Is software testing still popular in 2022?

以科技传递温度,vivo守护生物多样性之美

The communication principle between native components, applets and clients, and the operation principle of video, map, canvas, picker, etc

CANopen communication - PDO and SDO

How to install, download and use the latest version of IDM software

Design of hospital wireless network system

2022-07-22: what is the output of the following go language code? A:1; B:1.5; C: Compilation error; D:1.49。 package main import “fmt“ func main() { var i

Study and use of windows security defect detection tool wesng
![STM32 installation tutorial and j-link burning driver installation tutorial [the next day]](/img/09/def640c771f1b9effaaec3844d4cd3.png)
STM32 installation tutorial and j-link burning driver installation tutorial [the next day]

Distributed resource management and task scheduling framework yarn
随机推荐
Visual full link log tracking
Running around, market and quantitative page function optimization! Stock quantitative analysis tool qtyx-v2.4.5
Second and third order trade expressions of linear algebra
浅谈领域驱动设计
CANopen communication - PDO and SDO
[machine learning basics] common operations of Feature Engineering
5年接觸近百比特老板,身為獵頭的我,發現昇職的秘密不過4個字
J. Serval and essay (tarjan finds topological order)
奔走相告,行情与量化页面功能优化!股票量化分析工具QTYX-V2.4.5
Ora-12899 error caused by nchar character
Bank of Nanjing approved the financial technology post in advance
NETCORE - how to ensure that icollection or list privatization is not externally modified?
Halide:: generator instructions
jenkins多任務並發構建
Install go environment under Kali
STM32 concept and installation [day 1]
ASP.NET CORE写一个缓存Attribute工具
How CAD draws arrows with arcs
架构实战营模块二作业
解决script标签写在元素节点前面无法获取元素节点的问题