Commit 8c28c281 authored by 黄媛媛's avatar 黄媛媛
parents b72fd36c 8004ade9
...@@ -116,6 +116,9 @@ ...@@ -116,6 +116,9 @@
.banner-container .banner-img-cover{ .banner-container .banner-img-cover{
background-size: cover; background-size: cover;
} }
.bannerTopRadis{
overflow:hidden;
}
</style> </style>
<template> <template>
<div :class="{'active':banData.isCked}"> <div :class="{'active':banData.isCked}">
...@@ -126,7 +129,8 @@ ...@@ -126,7 +129,8 @@
<el-button type="primary" icon="el-icon-arrow-down" v-if="index!=dataLeng-1" @click="resetSord(1)" style="right: -25px; top: 30px;"></el-button> <el-button type="primary" icon="el-icon-arrow-down" v-if="index!=dataLeng-1" @click="resetSord(1)" style="right: -25px; top: 30px;"></el-button>
</div> </div>
<div class="diy-component-preview"> <div class="diy-component-preview">
<div class="banner-container" :style="{height:banData.data.height+'px'}"> <div class="banner-container bannerTopRadis" :style="{height:banData.data.height+'px',borderRadius:banData.data.radius+'px',
marginBottom:banData.data.topAndBottom+'px',marginTop:banData.data.topAndBottom+'px',marginLeft:banData.data.leftAndRight+'px',marginRight:banData.data.leftAndRight+'px'}">
<el-carousel :interval="3000" arrow="always" v-if="banData.data.style==1" :height="banData.data.height+'px'"> <el-carousel :interval="3000" arrow="always" v-if="banData.data.style==1" :height="banData.data.height+'px'">
<el-carousel-item v-for="(item,index) in banData.data.banners" :key="index"> <el-carousel-item v-for="(item,index) in banData.data.banners" :key="index">
<div class="banner-img" :class="banData.data.fill==1?'banner-img-cover':'banner-img-contain'" :style="{backgroundImage:'url('+getIconLink(item.picUrl)+')'}"></div> <div class="banner-img" :class="banData.data.fill==1?'banner-img-cover':'banner-img-contain'" :style="{backgroundImage:'url('+getIconLink(item.picUrl)+')'}"></div>
...@@ -198,6 +202,21 @@ ...@@ -198,6 +202,21 @@
</div> </div>
<el-button size="small" @click="addBanner()">添加轮播图</el-button> <el-button size="small" @click="addBanner()">添加轮播图</el-button>
</el-form-item> </el-form-item>
<el-form-item label="圆角">
<el-input type="number" size="small" v-model="banData.data.radius">
<template slot="append">px</template>
</el-input>
</el-form-item>
<el-form-item label="上下边距">
<el-input type="number" size="small" v-model="banData.data.topAndBottom" :min="0" @change="getminNum()">
<template slot="append">px</template>
</el-input>
</el-form-item>
<el-form-item label="左右边距">
<el-input type="number" size="small" v-model="banData.data.leftAndRight" :min="0" @change="getminNum()">
<template slot="append">px</template>
</el-input>
</el-form-item>
</el-form> </el-form>
</div> </div>
<el-dialog title="选择链接" :visible.sync="isShowLink" width="800px"> <el-dialog title="选择链接" :visible.sync="isShowLink" width="800px">
...@@ -305,6 +324,14 @@ ...@@ -305,6 +324,14 @@
}); });
this.isShowLunbo=false; this.isShowLunbo=false;
this.$refs.lunbo.toggleSelection(); this.$refs.lunbo.toggleSelection();
},
getminNum(){
if(this.banData.data.topAndBottom==''){
this.banData.data.topAndBottom=0;
}
if(this.banData.data.leftAndRight==''){
this.banData.data.leftAndRight=0;
}
} }
}, },
......
...@@ -563,6 +563,9 @@ ...@@ -563,6 +563,9 @@
fill: 1, //填充方式0-留白 1填充 fill: 1, //填充方式0-留白 1填充
height: 450, //默认高度 height: 450, //默认高度
banners: [], //轮播图 banners: [], //轮播图
radius:0, //圆角
topAndBottom:0, //上下边距
leftAndRight:0 //左右边距
} }
} }
this.dataList.push(banObj); this.dataList.push(banObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment