Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Элементы слайдера растягиваются по длине / 1 сообщений из 1, страница 1 из 1
29.10.2019, 19:13
    #39882890
mstdmstd
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Элементы слайдера растягиваются по длине
Привет!
установил в приложение расширение
https://github.surmon.me/vue-awesome-swiper/
пример
авторKeyboard Control ( Keyboard Control / Focus Left And Right Button )

но при этом отображая 3 элемента и навигацию

Код: javascript
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.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
<template>

    <div class="page_content_container item_container">

        <div class="news_listings_container mb-5">

            <div class="news_body ">

                <swiper :options="swiperOption"   ref="mySwiper">

                    <swiper-slide class="m-5" style="border: 4px dotted yellow !important; background-color: cyan !important;
                        max-width: 500px !important;">Slide 2</swiper-slide>
                    <swiper-slide class="m-5" style="border: 4px dotted yellow !important; background-color: cyan !important;
                        max-width: 500px !important;">Slide 3</swiper-slide>
                    <swiper-slide class="m-5" style="border: 4px dotted yellow !important; background-color: cyan !important;
                        max-width: 500px !important;">Slide 4</swiper-slide>
                    <div class="swiper-pagination" slot="pagination"></div>
                    <div class="swiper-button-prev" slot="button-prev"></div>
                    <div class="swiper-button-next" slot="button-next"></div>
                </swiper>

            </div>

        </div><!-- <div class="news_listings_container mb-4"> -->

    </div> <!-- 	<div class="page_content_container"> -->

</template>

<script>
    import {bus} from '../../../app';
    import appMixin from '../../../appMixin';

    import Vue from 'vue';
    import Vue2Filters from 'vue2-filters' 
    Vue.use(Vue2Filters)


    import 'swiper/dist/css/swiper.css'
    import {swiper, swiperSlide} from 'vue-awesome-swiper'


    export default {
        components: {
            swiper,
            swiperSlide
        },
        data: function () {


            return {

                swiperOption: {
                    slidesPerView: 1,
                    spaceBetween: 30,
                    keyboard: {
                        enabled: true,
                    },
                    pagination: {
                        el: '.swiper-pagination',
                        clickable: true
                    },
                    navigation: {
                        nextEl: '.swiper-button-next',
                        prevEl: '.swiper-button-prev'
                    }
                }
            }

        },
        name: 'TopNewsList',


        mounted() {
            this.setAppTitle('News', 'News', bus);
        }, // mounted() {


        mixins: [appMixin, Vue2Filters.mixin],

        methods: {}, // methods: {

        computed: {

            swiper() {
                return this.$refs.mySwiper.swiper
            },


            
        } //computed: {

    }


</script>



Код: css
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.
<style lang="scss" scoped>
    @import "./resources/sass/_variables.scss";

    .row_with_centered_cells {
        display: flex;
        font-size: 0.85em;
        width: 100%;

        justify-content: space-around;
        align-items: center;

        margin-top: 10px;
        border: 2px solid blue !important;
    }

    .swiper-pagination {
        margin-top: 20px;
        background-color: cadetblue !important;
    }
    .swiper-button-prev {
        background-color: lightblue !important;
    }
    .swiper-button-next {
        background-color: olive !important;
    }


</style>



Все 3 элемента растягиваются по ширине - а предполагалось что 1 виден а остальные спрятаны.
Полагаю что проблема в css но в чем...

Вживую тут : http://hostels2.my-demo-apps.tk/test

Спасибо!
...
Рейтинг: 0 / 0
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Элементы слайдера растягиваются по длине / 1 сообщений из 1, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]