Commit 2c1b0f91 authored by 陈龙's avatar 陈龙

feat: 优化滚动组件

parent 7496bf0a
......@@ -97,8 +97,6 @@ const AlarmScrollAssembly = (props) => {
runTimer(secondRequest?.data?.list.length || 0);
};
const runTimer = (num) => {
console.log('timer: ', num);
console.log(enableToGetData);
let _interval = props.interval || 0;
if (num > 200) _interval = 0;
timer = setTimeout(() => {
......@@ -126,16 +124,16 @@ const AlarmScrollAssembly = (props) => {
>
<Swiper
slidesPerView={1}
modules={[Pagination]}
pagination={
props.showTotal
? {
type: 'fraction',
formatFractionCurrent: (num) => `第${num}条`,
formatFractionTotal: (num) => `共${num}条`,
}
: false
}
// modules={[Pagination]}
// pagination={
// props.showTotal
// ? {
// type: 'fraction',
// formatFractionCurrent: (num) => `第${num}条`,
// formatFractionTotal: (num) => `共${num}条`,
// }
// : false
// }
navigation={props.showTotal ? true : false}
autoplay={{
delay: 3000,
......@@ -144,7 +142,6 @@ const AlarmScrollAssembly = (props) => {
loop
direction="vertical"
onSlideChange={(e) => {
console.log(enableToGetData);
if (e.activeIndex === realTimeDataList.length - 1 && enableToGetData) getData();
}}
>
......
......@@ -9,7 +9,8 @@
&.moreThan1000 {
:global {
.swiper-container {
width: 950px;
width: 100%;
min-width: 400px;
height: 42px;
.swiper-button-prev {
......@@ -46,7 +47,8 @@
&.lessThan1000 {
:global {
.swiper-container {
width: 950px;
width: 100%;
min-width: 400px;
height: 42px;
.swiper-button-prev {
......@@ -83,8 +85,8 @@
display: flex;
flex-direction: column;
gap: 8px;
//width: 100%;
min-width: 930px;
width: 100%;
min-width: 400px;
height: 42px;
//overflow-y: scroll;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment