|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
- <div class="content-container">
|
|
|
|
|
|
+ <div class="content-container w1200">
|
|
<div class="content-main">
|
|
<div class="content-main">
|
|
<slot name="default"></slot>
|
|
<slot name="default"></slot>
|
|
</div>
|
|
</div>
|
|
- <div class="content-right ad-container" :class="{ nothing: adList.length === 0 }">
|
|
|
|
|
|
+ <div class="content-right ad-container" :class="{ nothing: adList.length === 0 && autoExpand }">
|
|
<slot name="right">
|
|
<slot name="right">
|
|
<slot name="right-top"></slot>
|
|
<slot name="right-top"></slot>
|
|
<div class="ad-list">
|
|
<div class="ad-list">
|
|
@@ -27,6 +27,7 @@ import { getAdList } from '@/api/modules/'
|
|
export default {
|
|
export default {
|
|
name: 'content-layout',
|
|
name: 'content-layout',
|
|
props: {
|
|
props: {
|
|
|
|
+ // 是否需要获取广告位列表(不获取则不会显示广告位)
|
|
needAd: {
|
|
needAd: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: true
|
|
default: true
|
|
@@ -38,6 +39,11 @@ export default {
|
|
adNum: {
|
|
adNum: {
|
|
type: Number,
|
|
type: Number,
|
|
default: 2
|
|
default: 2
|
|
|
|
+ },
|
|
|
|
+ // 如果没有广告位,是否宽度自适应铺满
|
|
|
|
+ autoExpand: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -77,7 +83,7 @@ export default {
|
|
const { data } = await getAdList(params)
|
|
const { data } = await getAdList(params)
|
|
|
|
|
|
if (Array.isArray(data)) {
|
|
if (Array.isArray(data)) {
|
|
- this.adList = data
|
|
|
|
|
|
+ this.adList = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -91,6 +97,7 @@ export default {
|
|
padding-bottom: 60px;
|
|
padding-bottom: 60px;
|
|
.content-main {
|
|
.content-main {
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
+ transition: .1s;
|
|
}
|
|
}
|
|
.content-right {
|
|
.content-right {
|
|
width: 264px;
|
|
width: 264px;
|