improve search tags while add/edit events
This commit is contained in:
parent
c7ae5420dc
commit
d6f7b68c5c
1 changed files with 8 additions and 6 deletions
|
@ -51,10 +51,11 @@
|
||||||
v-combobox(v-model='event.tags'
|
v-combobox(v-model='event.tags'
|
||||||
:prepend-icon="mdiTagMultiple"
|
:prepend-icon="mdiTagMultiple"
|
||||||
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
|
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
|
||||||
no-filter
|
cache-items
|
||||||
@input.native='searchTags'
|
@input.native='searchTags'
|
||||||
:delimiters="[',', ';']"
|
:delimiters="[',', ';']"
|
||||||
:items="tags"
|
:items="tags"
|
||||||
|
:menu-props="{ maxWidth: 400, eager: true }"
|
||||||
:label="$t('common.tags')")
|
:label="$t('common.tags')")
|
||||||
template(v-slot:selection="{ item, on, attrs, selected, parent}")
|
template(v-slot:selection="{ item, on, attrs, selected, parent}")
|
||||||
v-chip(v-bind="attrs" close :close-icon='mdiCloseCircle' @click:close='parent.selectItem(item)'
|
v-chip(v-bind="attrs" close :close-icon='mdiCloseCircle' @click:close='parent.selectItem(item)'
|
||||||
|
@ -79,10 +80,10 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
List: () => import(/* webpackChunkName: "add" */'@/components/List'),
|
List: () => import(/* webpackChunkName: "add" */'@/components/List'),
|
||||||
Editor: () => import(/* webpackChunkName: "add" */'@/components/Editor'),
|
Editor: () => import(/* webpackChunkName: "add" */'@/components/Editor'),
|
||||||
ImportDialog: () => import(/* webpackChunkName: "add" */'./ImportDialog.vue'),
|
ImportDialog: () => import(/* webpackChunkName: "add" */'@/components/ImportDialog.vue'),
|
||||||
MediaInput: () => import(/* webpackChunkName: "add" */'./MediaInput.vue'),
|
MediaInput: () => import(/* webpackChunkName: "add" */'@/components/MediaInput.vue'),
|
||||||
WhereInput: () => import(/* webpackChunkName: "add" */'./WhereInput.vue'),
|
WhereInput: () => import(/* webpackChunkName: "add" */'@/components/WhereInput.vue'),
|
||||||
DateInput: () => import(/* webpackChunkName: "add" */'./DateInput.vue')
|
DateInput: () => import(/* webpackChunkName: "add" */'@/components/DateInput.vue')
|
||||||
},
|
},
|
||||||
validate ({ store }) {
|
validate ({ store }) {
|
||||||
return (store.state.auth.loggedIn || store.state.settings.allow_anon_event)
|
return (store.state.auth.loggedIn || store.state.settings.allow_anon_event)
|
||||||
|
@ -160,8 +161,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
searchTags: debounce( async function(ev) {
|
searchTags: debounce( async function(ev) {
|
||||||
const search = ev.target.value
|
const search = ev.target.value
|
||||||
|
if (!search) return
|
||||||
this.tags = await this.$axios.$get(`/tag?search=${search}`)
|
this.tags = await this.$axios.$get(`/tag?search=${search}`)
|
||||||
}),
|
}, 100),
|
||||||
eventImported (event) {
|
eventImported (event) {
|
||||||
this.event = Object.assign(this.event, event)
|
this.event = Object.assign(this.event, event)
|
||||||
this.$refs.where.selectPlace({ name: event.place.name, create: true })
|
this.$refs.where.selectPlace({ name: event.place.name, create: true })
|
||||||
|
|
Loading…
Reference in a new issue