Commit 688f53ec authored by Dennis Tang's avatar Dennis Tang

use v-model for dropdown search input

parent 86413c95
......@@ -3,29 +3,31 @@ import { __ } from '~/locale';
export default {
props: {
searchQuery: {
type: String,
required: false,
default: '',
},
placeholderText: {
type: String,
required: true,
default: __('Search'),
},
},
data() {
return { searchQuery: this.value };
},
watch: {
searchQuery(query) {
this.$emit('input', query);
},
},
};
</script>
<template>
<div class="dropdown-input">
<input
autocomplete="off"
class="dropdown-input-field"
type="search"
v-model="searchQuery"
:placeholder="placeholderText"
:searchQuery="searchQuery"
@input="$emit('input', $event.target.value)"
autocomplete="off"
/>
<i
aria-hidden="true"
......
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