xadmin可视化上传图片


xadmin可视化上传图片

# 1.管理员登入录入数据

Banner.vue组件改造

<!-- 修改Banner.vue组件 -->
<template>
    <el-carousel height="520px" :interval="3000" arrow="always">
        <el-carousel-item v-for="item in banner_list">
            <a :href="item.link">
                <img :src="item.image" alt="">
            </a>
        </el-carousel-item>
    </el-carousel>
</template>
<script>
    export default {
        name: "Banner",
        data: function () {
            return {
                banner_list: []
            }
        },
        created: function () {
            let _this = this;
            this.$axios({
                url: this.$settings.Host + '/home/banner/',
            }).then(function (response) {
                _this.banner_list = response.data;
            }).catch(function (error) {
                console.log(error)
            })
        }
    }
</script>

<style scoped>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 18px;
        opacity: 0.75;
        line-height: 300px;
        margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
    img {
        text-align: center;
        height: 520px;
    }
</style>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM