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>
<zotero-vue-client :default-type="resourceType" :default-id="groupOrUserId" @entrySelected="selectedEntry"/>
<zotero-vue-client :default-type="resourceType" :default-id="groupOrUserId" @entry-selected="selectedEntry"/>
</template>
<script>
......@@ -18,8 +18,9 @@
},
methods : {
selectedEntry(e){
alert(e)
selectedEntry(entryKey, serializedEntry){
console.log("entry key = ", entryKey)
alert(serializedEntry)
}
}
}
......
......@@ -136,7 +136,7 @@
entrySelected(entryKey){
fetch('https://api.zotero.org/'
+ 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