Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
2c1b0f91
Commit
2c1b0f91
authored
May 26, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化滚动组件
parent
7496bf0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
index.js
packages/base-components/AlarmScrollAssembly/src/index.js
+10
-13
index.less
packages/base-components/AlarmScrollAssembly/src/index.less
+6
-4
No files found.
packages/base-components/AlarmScrollAssembly/src/index.js
View file @
2c1b0f91
...
...
@@ -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
();
}}
>
...
...
packages/base-components/AlarmScrollAssembly/src/index.less
View file @
2c1b0f91
...
...
@@ -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:
93
0px;
width: 100%;
min-width:
40
0px;
height: 42px;
//overflow-y: scroll;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment