collection search added
This commit is contained in:
parent
8b11ee57cb
commit
6a94d8ef63
2 changed files with 40 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, watch } from 'vue'
|
||||
import router from '@/router/index.js'
|
||||
|
||||
|
||||
|
|
@ -12,6 +12,28 @@ const options = [
|
|||
const addMerch = () => {
|
||||
router.push({ name: 'addMerch' })
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const localValue = ref(props.modelValue)
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
localValue.value = newVal
|
||||
}
|
||||
)
|
||||
|
||||
watch(localValue, (newVal) => {
|
||||
emit('update:modelValue', newVal)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -19,7 +41,7 @@ const addMerch = () => {
|
|||
<n-button type="primary" class="toolbar-item" @click="addMerch"> Add merch </n-button>
|
||||
|
||||
<div class="search-wrapper toolbar-item">
|
||||
<n-input placeholder="Search..." clearable />
|
||||
<n-input v-model:value="localValue" placeholder="Search..." clearable />
|
||||
</div>
|
||||
|
||||
<div class="selector toolbar-item">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue