Fix category autocomplete.

This commit is contained in:
James Cole 2020-07-19 18:03:02 +02:00
parent 3619427f60
commit edf6ece7cb
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
3 changed files with 12 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -49,7 +49,7 @@
:open-on-empty=true
:open-on-focus=true
v-on:input="selectedItem"
:async-src="categoryAutoCompleteURI"
:async-function="categoryAutoCompleteURI"
v-model="name"
:target="target"
item-key="name"
@ -91,6 +91,15 @@
hasError: function () {
return this.error.length > 0;
},
aSyncFunction: function (query, done) {
axios.get(this.categoryAutoCompleteURI + query)
.then(res => {
done(res.data);
})
.catch(err => {
// any error handler
})
},
handleInput(e) {
if (typeof this.$refs.input.value === 'string') {
this.$emit('input', this.$refs.input.value);