250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- activeIndex
- eslint prettier
- eslint
- JavaScript
- index
- jquery
- centerSlides
- 인덱스
- Vue
- slideChange
- archiver
- error
- loop:true
- javascirpt
- CORS
- slidePerGroup
- js
- vscode
- watchOverflow
- querySelector
- slidePerView
- swiper
- classlist
- display
- css
- vue2
- v-bind
- realIndex
- swiperOption
- prettier
Archives
- Today
- Total
목록realIndex (1)
코딩하는 둥둥
[ Vue2 ] Swiper외부에서 Swiper Index 사용하기
요구사항 swiper가 스와이핑될 때마다 swiper 외부 요소의 값도 변경되는 로직을 구현하기위해 swiper의 index값을 스와이퍼 외부에서 사용할수 있도록 해야했다. 구현 슬라이드의 인덱스를 변수에 저장해, 그 변수를 활용해 외부 요소의 값을 변경하도록 구현하려고했다. 기존에 스와이핑 될때마다 css를 변경하는 로직을 slideChange에서 구현했기때문에 마찬가지로 swiper index도 slideChange에서 realIndex를 사용해 변수로 넘겨주고자했다. 이때 activeIndex가 아니라 realIndex를 사용한 이유는 loop:true를 사용했기때문에 activeIndex가 현재 슬라이드 순서와 달랐기때문이다. activeIndex : 현재 활성 슬라이드의 인덱스 번호 ※ loop..
Frontend/Vue.js
2023. 2. 8. 17:58