Commit aa1b48f8 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

ajout clé de l'entrée sélectionnée en paramètre de l'event selected-entry

parent c965ebed
<template> <template>
<zotero-vue-client :default-type="resourceType" :default-id="groupOrUserId" @entrySelected="selectedEntry"/> <zotero-vue-client :default-type="resourceType" :default-id="groupOrUserId" @entry-selected="selectedEntry"/>
</template> </template>
<script> <script>
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
}, },
methods : { methods : {
selectedEntry(e){ selectedEntry(entryKey, serializedEntry){
alert(e) console.log("entry key = ", entryKey)
alert(serializedEntry)
} }
} }
} }
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
entrySelected(entryKey){ entrySelected(entryKey){
fetch('https://api.zotero.org/' fetch('https://api.zotero.org/'
+ this.type + 's' +'/' + this.groupOrUserId + '/items/' + entryKey + '?format=' + this.format) + this.type + 's' +'/' + this.groupOrUserId + '/items/' + entryKey + '?format=' + this.format)
.then(response => response.text()).then(entry => { this.$emit('entry-selected', entry)}) .then(response => response.text()).then(entry => { this.$emit('entry-selected',entryKey, entry)})
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment