modal-example.vue 1.97 KB
<template>
    <Modal
            v-model="showExample"
            width="700"
            title="色卡图片示例">
        <div>
            <div>
                <div class="example-1"></div>
                <div class="example-2"></div>
                <div class="example-3"></div>
                <div class="example-4"></div>
                <div class="example-5"></div>
            </div>
            <div>
                <span class="example-title">商品正面图</span>
                <span class="example-title">商品反面图</span>
                <span class="example-title">模特图</span>
                <span class="example-title">男生频道封面图</span>
                <span class="example-title">女生频道封面图</span>
            </div>
        </div>

        <div slot="footer" style="text-align: center">
            <Button type="primary" size="large"  @click="close">关闭</Button>
        </div>
    </Modal>
</template>

<script>
    export default {
        name: 'example',
        data() {
            return {
                showExample: false
            };
        },
        methods: {
            show() {
                this.showExample = true;
            },
            close() {
                this.showExample = false;
            }
        }
    };
</script>

<style lang="scss">
    @mixin exampleImg ($num: 1) {
        display: inline-block;
        width: 100px;
        height: 150px;
        border-radius: 3px;
        background-image: url(../../images/example/#{$num}.png);
        background-repeat: no-repeat;
        margin: 15px 15px;
    }

    .example-1 {
        @include exampleImg(1);
    }

    .example-2 {
        @include exampleImg(2);
    }

    .example-3 {
        @include exampleImg(3);
    }

    .example-4 {
        @include exampleImg(4);
    }

    .example-5 {
        @include exampleImg(5);
    }

    .example-title {
        display: inline-block;
        width: 130px;
        text-align: center;
    }
</style>