Browse Source

add image if no content on text card

axolotle 2 years ago
parent
commit
cf8bcef60a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/components/nodes/NodeViewBody.vue

+ 7 - 0
src/components/nodes/NodeViewBody.vue

@@ -10,6 +10,13 @@
         :node="node"
       />
 
+      <div
+        v-if="mode === 'card' && !node.content && !!node.images && !!node.images.length"
+        class="node-view-img-wrapper mt-3"
+      >
+        <img :src="node.images[0].url" :alt="node.images[0].alt">
+      </div>
+
       <div class="node-view-body-wrapper" v-html="node.content" />
 
       <div class="node-view-gallery" v-if="mode === 'view'">