|
5 | 5 | :style="{width: width.track + 'px', transform: 'translate(-' + transform + 'px)', transition: 'transform ' + timing_ + ' ' + transitionDelay + 'ms'}">
|
6 | 6 | <slot></slot>
|
7 | 7 | </div>
|
8 |
| - |
9 |
| - <ul v-if="dots_" class="agile__dots"> |
10 |
| - <li v-for="n in slidesCount" class="agile__dot" |
11 |
| - :class="{'agile__dot--current': n - 1 === currentSlide}"> |
12 |
| - <button @click="setSlide(n - 1)">{{n}}</button> |
13 |
| - </li> |
14 |
| - </ul> |
15 |
| - |
16 |
| - <button v-if="arrows_" class="agile__arrow agile__arrow--prev" |
17 |
| - :disabled="currentSlide === 0 && !infinite_" @click="prevSlide" v-html="arrow_"> |
18 |
| - </button> |
19 |
| - <button v-if="arrows_" class="agile__arrow agile__arrow--next" |
20 |
| - :disabled="currentSlide === slidesCount - 1 && !infinite_" @click="nextSlide" v-html="arrow_"> |
21 |
| - </button> |
22 | 8 | </div>
|
| 9 | + |
| 10 | + <ul v-if="dots_" class="agile__dots"> |
| 11 | + <li v-for="n in slidesCount" class="agile__dot" |
| 12 | + :class="{'agile__dot--current': n - 1 === currentSlide}"> |
| 13 | + <button @click="setSlide(n - 1)">{{n}}</button> |
| 14 | + </li> |
| 15 | + </ul> |
| 16 | + |
| 17 | + <button v-if="arrows_" class="agile__arrow agile__arrow--prev" |
| 18 | + :disabled="currentSlide === 0 && !infinite_" @click="prevSlide" v-html="prevArrow_"> |
| 19 | + </button> |
| 20 | + <button v-if="arrows_" class="agile__arrow agile__arrow--next" |
| 21 | + :disabled="currentSlide === slidesCount - 1 && !infinite_" @click="nextSlide" v-html="nextArrow_"> |
| 22 | + </button> |
23 | 23 | </div>
|
24 | 24 | </template>
|
25 | 25 |
|
|
28 | 28 | name: 'agile',
|
29 | 29 |
|
30 | 30 | props: {
|
31 |
| - arrow: { |
| 31 | + prevArrow: { |
32 | 32 | type: String,
|
33 |
| - default: '<svg version="1.1" id="arrow-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823;" xml:space="preserve"><g><path id="arrow" d="M183.189,111.816L74.892,3.555c-4.752-4.74-12.451-4.74-17.215,0c-4.752,4.74-4.752,12.439,0,17.179 l99.707,99.671l-99.695,99.671c-4.752,4.74-4.752,12.439,0,17.191c4.752,4.74,12.463,4.74,17.215,0l108.297-108.261 C187.881,124.315,187.881,116.495,183.189,111.816z"/></g></svg>' |
| 33 | + default: '<svg x="0px" y="0px" viewBox="0 0 24 24"><path d="M16.2,21c0.3,0,0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L9.6,12L17,4.7c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0L6.8,12l8.8,8.7C15.7,20.9,16,21,16.2,21z"/></svg>' |
| 34 | + }, |
| 35 | +
|
| 36 | + nextArrow: { |
| 37 | + type: String, |
| 38 | + default: '<svg x="0px" y="0px" viewBox="0 0 24 24"><path d="M7.8,21c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l7.4-7.3L7,4.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l8.8,8.7l-8.8,8.7C8.3,20.9,8,21,7.8,21z"/></svg>' |
34 | 39 | },
|
35 | 40 |
|
36 | 41 | arrows: {
|
|
110 | 115 | track: 0
|
111 | 116 | },
|
112 | 117 | slidesToShow: 1,
|
113 |
| - arrow_: this.arrow, |
| 118 | + prevArrow_: this.prevArrow, |
| 119 | + nextArrow_: this.nextArrow, |
114 | 120 | arrows_: this.arrows,
|
115 | 121 | autoplay_: this.autoplay,
|
116 | 122 | autoplaySpeed_: this.autoplaySpeed,
|
|
479 | 485 |
|
480 | 486 | &__arrow {
|
481 | 487 | border: none;
|
482 |
| - bottom: 10px; |
| 488 | + bottom: -10px; |
483 | 489 | margin: 0;
|
484 | 490 | padding: 0;
|
485 | 491 | position: absolute;
|
|
491 | 497 | }
|
492 | 498 |
|
493 | 499 | &:hover {
|
494 |
| - #arrow-svg { |
| 500 | + svg { |
495 | 501 | fill: #333;
|
496 | 502 | }
|
497 | 503 | }
|
498 | 504 |
|
499 | 505 | &--prev {
|
500 | 506 | left: 0;
|
501 |
| -
|
502 |
| - #arrow-svg { |
503 |
| - transform: scale(-1, 1); |
504 |
| - } |
505 | 507 | }
|
506 | 508 |
|
507 | 509 | &--next {
|
508 | 510 | right: 0;
|
509 | 511 | }
|
510 | 512 |
|
511 |
| - #arrow-svg { |
| 513 | + svg { |
512 | 514 | fill: #888;
|
513 |
| - height: 20px; |
| 515 | + height: 24px; |
514 | 516 | transition-duration: .3s;
|
515 | 517 | }
|
516 | 518 | }
|
|
0 commit comments