Skip to content
Snippets Groups Projects
Commit 183fe8d1 authored by Mathieu Massaviol's avatar Mathieu Massaviol
Browse files

Merge branch '58-bug-concept-browser-quand-non-multiple' into 'main'

Resolve "bug Concept browser quand non-multiple"

Closes #58

See merge request !65
parents fa934e33 62e78a77
Branches
No related tags found
1 merge request!65Resolve "bug Concept browser quand non-multiple"
Pipeline #10678 passed
......@@ -48,4 +48,19 @@ export const WithBrowser: Story = {
vocabulariesUriList: ['https://data.archives-ouvertes.fr/subject', 'http://publications.europa.eu/resource/authority/country'],
withBrowser: true
},
};
export const WithBrowserNotMutliple: Story = {
render: (args) => ({
components: { OcConceptAutocomplete },
setup() {
return { args };
},
template: '<OcConceptAutocomplete v-bind="args" />',
}),
args: {
vocabulariesUriList: ['https://data.archives-ouvertes.fr/subject', 'http://publications.europa.eu/resource/authority/country'],
withBrowser: true,
multiple: false
},
};
\ No newline at end of file
......@@ -51,7 +51,7 @@ import Message from 'primevue/message'
import Button from 'primevue/button'
import Dialog from 'primevue/dialog'
import OcConceptBrowser from '@/components/FormInputs/OcConceptBrowser/OcConceptBrowser.vue'
import { ref } from 'vue'
import { ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { queryVocabulariesList } from '@/sparql/vocabularies'
......@@ -103,4 +103,10 @@ async function search(query: string) {
loading.value = false
}
watch(model, () => {
if(!props.multiple && isBrowserVisible.value){
isBrowserVisible.value = false
}
})
</script>
......@@ -110,12 +110,10 @@ const onNodeSelect = (node: TreeNode) => {
]
}
} else {
model.value = [
{
model.value = {
'@id': node.key,
prefLabel: node.label
}
]
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment