|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div id="news">
|
|
|
<el-row>
|
|
|
- <el-col :span="24" class="news">
|
|
|
+ <el-col :span="24" class="news" v-if="haveData(news)">
|
|
|
<el-col :span="24" class="topTit">
|
|
|
<el-col :span="20">
|
|
|
<span :style="`border-color:${borderColor}`">{{ news.title }}</span>
|
|
@@ -36,17 +36,23 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" v-else>
|
|
|
+ <no-data></no-data>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import noData from '@publics/src/layout/noData.vue';
|
|
|
export default {
|
|
|
name: 'news',
|
|
|
props: {
|
|
|
news: null,
|
|
|
},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ noData,
|
|
|
+ },
|
|
|
data: () => ({
|
|
|
borderColor: '#850000',
|
|
|
Color: '#850000',
|
|
@@ -54,6 +60,21 @@ export default {
|
|
|
created() {},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
+ haveData(data) {
|
|
|
+ let res = false;
|
|
|
+ if (data !== null) {
|
|
|
+ if (_.isArray(data)) {
|
|
|
+ return data.length > 0;
|
|
|
+ } else {
|
|
|
+ let object = _.get(data, 'children', undefined);
|
|
|
+ if (object === undefined) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return this.haveData(object);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
shuYi(index) {
|
|
|
this.$refs.shubiao.setActiveItem(`${index}`);
|
|
|
},
|