fix: ESC后搜索框内容不清空的问题

This commit is contained in:
ZiuChen 2022-08-15 18:10:05 +08:00
parent 2a454983fd
commit 069675f7c3

View File

@ -6,15 +6,21 @@
<script setup>
import { ref, watch } from 'vue'
const filterText = ref('')
const props = defineProps({
modelValue: {
type: String,
required: true
}
})
const filterText = ref('')
const emit = defineEmits(['update:modelValue'])
// filterText modelValue
watch(filterText, (val) => emit('update:modelValue', val))
// modelValue filterText
watch(
() => props.modelValue,
(val) => (filterText.value = val)
)
</script>
<style lang="less" scoped>