Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
48a42e0b
Commit
48a42e0b
authored
Sep 11, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
4ec43902
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
src/components/Index/TopSwiper/index.js
+15
-7
src/components/Index/TopSwiper/index.scss
+31
-0
No files found.
src/components/Index/TopSwiper.js
→
src/components/Index/TopSwiper
/index
.js
View file @
48a42e0b
import
React
,
{
Component
}
from
'react'
;
import
Swiper
from
'swiper'
import
'./index.scss'
import
'swiper/dist/css/swiper.min.css'
class
TopSwiper
extends
Component
{
class
Index
extends
Component
{
container
=
null
swiper
componentDidMount
()
{
const
{
bannerList
}
=
this
.
props
const
_this
=
this
this
.
swiper
=
new
Swiper
(
'.swiper-container'
,
{
direction
:
'horizontal'
,
loop
:
true
,
on
:{
progress
(
e
){
console
.
log
(
e
);
spaceBetween
:
12
,
centeredSlides
:
true
,
slidesPerView
:
'auto'
,
loopedSlides
:
2
,
on
:
{
sliderMove
()
{
}
}
})
}
...
...
@@ -21,7 +29,7 @@ class TopSwiper extends Component {
render
()
{
const
{
bannerList
}
=
this
.
props
return
(
<
div
className
=
{
'swiper-container
index-swiper
'
}
ref
=
{
el
=>
this
.
container
=
el
}
>
<
div
className
=
{
'swiper-container'
}
ref
=
{
el
=>
this
.
container
=
el
}
>
<
ul
className
=
"swiper-wrapper"
>
{
bannerList
.
length
&&
bannerList
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -36,4 +44,4 @@ class TopSwiper extends Component {
}
}
export
default
TopSwiper
;
\ No newline at end of file
export
default
Index
;
\ No newline at end of file
src/components/Index/TopSwiper/index.scss
0 → 100644
View file @
48a42e0b
.swiper
{
&
-container
{
padding
:
0
20px
!
important
;
}
&
-slide
{
transform
:
scale3d
(
1
,
0
.9
,
1
);
img
{
width
:
100%
!
important
;
height
:
100%
!
important
;
}
&
-active
{
width
:
335px
!
important
;
height
:
168px
!
important
;
transform
:
scale3d
(
1
,
1
,
1
);
img
{
width
:
100%
!
important
;
height
:
100%
!
important
;
}
}
}
img
{
width
:
100%
;
height
:
100%
;
}
}
\ No newline at end of file
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