|
@@ -74,7 +74,8 @@
|
|
|
|
|
|
|
|
<div class="content" v-html="articlesData.content.value.content">
|
|
<div class="content" v-html="articlesData.content.value.content">
|
|
|
</div>
|
|
</div>
|
|
|
- <a-empty v-if="!articlesData.content.value.content && !articlesData.content.value.image"
|
|
|
|
|
|
|
+ <video v-if="articlesData.content.value.video" :src="articlesData.content.value.video" controls></video>
|
|
|
|
|
+ <a-empty v-if="isEmpty"
|
|
|
description="暂无内容"
|
|
description="暂无内容"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -118,6 +119,11 @@ const articlesData = await useSSrSimpleDataLoader('articles' + articleId, async
|
|
|
return res.data;
|
|
return res.data;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const isEmpty = computed(() => articlesData.content.value
|
|
|
|
|
+ && !articlesData.content.value.content
|
|
|
|
|
+ && !articlesData.content.value.image
|
|
|
|
|
+ && !articlesData.content.value.video);
|
|
|
|
|
+
|
|
|
watch(() => route.query.id, async (newVal, oldVal) => {
|
|
watch(() => route.query.id, async (newVal, oldVal) => {
|
|
|
if (newVal !== oldVal) {
|
|
if (newVal !== oldVal) {
|
|
|
articlesData.loadData(undefined, true);
|
|
articlesData.loadData(undefined, true);
|