Commit 93bff2dd authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

ajout du paramètrage du type de ressource (user|group), et utilisation du user...

ajout du paramètrage du type de ressource (user|group), et utilisation du user zotero 475425 par défaut
parent 760a97f6
VUE_APP_APP_NAME=Zotero Client VUE_APP_APP_NAME=Zotero Client
VUE_APP_URL_PATH=/zotero-vue-client/ VUE_APP_URL_PATH=/zotero-vue-client/
VUE_APP_DEFAULT_USER_GROUP_ID=475425
VUE_APP_DEFAULT_TYPE=user
...@@ -23,16 +23,17 @@ yarn lint ...@@ -23,16 +23,17 @@ yarn lint
## component usage example ## component usage example
``` ```
<zotero-query-component :default-id="1234" @entrySelected="selectedEntryCallback"/> <zotero-query-component :default-type="user" :default-id="1234" @entrySelected="selectedEntryCallback"/>
``` ```
where default-id is a group or user id (https://www.zotero.org/support/dev/web_api/v3/basics) where default-type is "user" or "group" and default-id is a group or user id (https://www.zotero.org/support/dev/web_api/v3/basics)
Another example with custom options : Another example with custom options :
``` ```
<zotero-query-component <zotero-query-component
:default-id="1234" :default-type="user"
:default-id="475425"
:options="{ :options="{
pageLength: 10, pageLength: 10,
editableConfig: false, editableConfig: false,
......
<template> <template>
<zotero-query-component :default-id="groupOrUserId" @entrySelected="selectedEntry"/> <zotero-query-component :default-type="resourceType" :default-id="groupOrUserId" @entrySelected="selectedEntry"/>
</template> </template>
<script> <script>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
}, },
data(){ data(){
return { return {
resourceType: config.RESOURCE_TYPE,
groupOrUserId: config.USER_GROUP_ID groupOrUserId: config.USER_GROUP_ID
} }
}, },
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
defaultId : String, defaultId : String,
defaultType : { defaultType : {
type : String, type : String,
default : 'group' default : 'users'
}, },
options : { options : {
type: Object, type: Object,
......
var config = { var config = {
RESOURCE_TYPE : process.env.VUE_APP_DEFAULT_TYPE,
USER_GROUP_ID: process.env.VUE_APP_DEFAULT_USER_GROUP_ID, USER_GROUP_ID: process.env.VUE_APP_DEFAULT_USER_GROUP_ID,
API_KEY: process.env.VUE_APP_ZOTERO_API_KEY, API_KEY: process.env.VUE_APP_ZOTERO_API_KEY,
......
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