mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-08 06:16:18 +08:00
fix: ESC后搜索框内容不清空的问题
This commit is contained in:
parent
2a454983fd
commit
069675f7c3
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user