focus.vue 1.66 KB
<template>
    <div class="focus-floor">
        <swipe class="swipe swipe-{{floor.length}}">
            <swipe-item v-for="item in floor" :style="{backgroundColor: item.bgColor}">
                <a :href="item.url | transformBlk" :title="item.title">
                    <img :src="item.src | resize 750 365">
                </a>
            </swipe-item>
        </swipe>
    </div>
</template>

<script>
    require('vue-swipe/dist/vue-swipe.css');
    const swipe = require('vue-swipe');

    module.exports = {
        props: ['floor'],
        components: {
            swipe: swipe.Swipe,
            swipeItem: swipe.SwipeItem
        }
    };
</script>

<style>
    .focus-floor {
        .swipe {
            position: relative;
            height: 100%;
        }

        .swipe-1 {
            .swipe-indicators {
                display: none;
            }
        }

        .swipe-item {
            a {
                display: block;
            }

            img {
                width: 100%;
                height: 100%;
            }
        }

        .swipe-indicators {
            left: initial;
            right: 30px;
            transform: none;
        }

        .swipe-indicator {
            width: 16px;
            height: 16px;
            background: #ccc;
            opacity: 1;
            vertical-align: middle;
            border-radius: 50%;
            transform: scale(0.5, 0.5);
            margin-left: -4px;

            &.active {
                width: 24px;
                height: 24px;
                background: #fff;
                border-radius: 50%;
                transform: scale(0.5, 0.5);
            }
        }
    }
</style>