display images, videos & files in text body
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<figure class="node-view-figure mt-2 mb-4">
|
||||
<div class="node-view-img-wrapper">
|
||||
<img :src="image.url" :alt="image.alt">
|
||||
<img :src="node.image.url" :alt="node.image.alt">
|
||||
|
||||
<button-expand @click="onImageExpand" v-b-modal="'modal-image-' + node.id" />
|
||||
<b-button variant="creation" class="btn-shadow btn-artwork" @click="onCreationClick">
|
||||
@@ -31,29 +31,16 @@ export default {
|
||||
node: { type: Object, required: true }
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
image: undefined
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
trim,
|
||||
toCommaList,
|
||||
|
||||
onImageExpand () {
|
||||
this.$emit('expand-image', this.image)
|
||||
this.$emit('expand-image', this.node.image)
|
||||
},
|
||||
|
||||
onCreationClick () {
|
||||
this.$store.dispatch('OPEN_CREATION', this.node.id)
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
if (this.node.images && this.node.images.length) {
|
||||
const { url, alt, id } = this.node.images[0]
|
||||
this.image = { alt, id, url }
|
||||
this.$store.dispatch('OPEN_CREATION', { id: this.node.id, map: false })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user