list attachments of item, see #11
This commit is contained in:
parent
d4e550aadc
commit
eb25f187cd
|
@ -56,7 +56,20 @@
|
|||
|
||||
<div
|
||||
class="box">
|
||||
<p>--</p>
|
||||
|
||||
<div
|
||||
v-if="attachments && attachments.length > 0">
|
||||
<span
|
||||
v-for="(attachment, index) in attachments"
|
||||
:key="index"
|
||||
>
|
||||
<a
|
||||
target="blank"
|
||||
:href="attachment.guid.rendered">{{ attachment.guid.rendered }}</a>
|
||||
</span>
|
||||
</div>
|
||||
<p v-else>--</p>
|
||||
|
||||
<p>
|
||||
<i>
|
||||
{{ $i18n.get('label_attachments') }}
|
||||
|
@ -83,15 +96,20 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
...mapActions('item', [
|
||||
'fetchItem'
|
||||
'fetchItem',
|
||||
'fetchAttachments'
|
||||
]),
|
||||
...mapGetters('item', [
|
||||
'getItem'
|
||||
'getItem',
|
||||
'getAttachments'
|
||||
]),
|
||||
},
|
||||
computed: {
|
||||
item(){
|
||||
return this.getItem();
|
||||
},
|
||||
attachments(){
|
||||
return this.getAttachments();
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
@ -107,6 +125,11 @@ export default {
|
|||
this.fetchItem(this.itemId).then(() => {
|
||||
loadingInstance.isLoading = false;
|
||||
});
|
||||
|
||||
// Get attachments
|
||||
this.fetchAttachments(this.itemId).then((result) => {
|
||||
this.$console.log( result, 'attachments' );
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue