当前位置:网站首页>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>
边栏推荐
- 图解数组和链表详细对比,性能测试
- Ora-12899 error caused by nchar character
- STM32概念和安装【第一天】
- 利用canvas画图片
- Preliminary use of 145 keep alive
- Non boost ASIO notes: UDP UART socketcan multicast UDS
- Basic knowledge of mathematical vector
- Deliver temperature with science and technology, vivo protects the beauty of biodiversity
- The communication principle between native components, applets and clients, and the operation principle of video, map, canvas, picker, etc
- CANopen communication - PDO and SDO
猜你喜欢

Exchange 2010通配符SSL证书安装文档

5年接觸近百比特老板,身為獵頭的我,發現昇職的秘密不過4個字

LiteSpeed Web服务器中安装SSL证书

Study and use of burpsuite plug-in

ASP.NET CORE写一个缓存Attribute工具

Small volume stock trading record | based on multi task crawler technology, realize level1 sampling of A-share real-time market

Jmeter+influxdb+grafana pressure measurement real-time monitoring platform construction

Visual full link log tracking

毕业设计校园信息发布平台网站源码

Three document usage
随机推荐
快速排序注意点
Running around, market and quantitative page function optimization! Stock quantitative analysis tool qtyx-v2.4.5
Redis 6.0 source code learning simple dynamic string
Build a CPU Simulator
使用第三方账号登录
Database paradigm and schema decomposition
What is restful
Chapter 9.2 program control of MATLAB
Jmeter+influxdb+grafana pressure measurement real-time monitoring platform construction
Database design
小散量化炒股记|基于多任务爬虫技术, 实现A股实时行情Level1采样
View binding confusion. I have been studying confusion for two days.
Draw pictures with canvas
Writing of graph nodes that trigger different special effects during the day and at night in Tiktok
浅谈元宇宙中DeFi的可能性和局限性
C - structure
浅谈领域驱动设计
Cartland number---
LiteSpeed Web服务器中安装SSL证书
Decrypt redis to help the e-commerce seckill system behind the double 11