mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-08-18 23:09:31 +08:00
fix: ESC后搜索框内容不清空的问题
This commit is contained in:
parent
2a454983fd
commit
069675f7c3
@ -6,15 +6,21 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
const filterText = ref('')
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const filterText = ref('')
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
// filterText变了 通知父组件修改 modelValue的值
|
||||||
watch(filterText, (val) => emit('update:modelValue', val))
|
watch(filterText, (val) => emit('update:modelValue', val))
|
||||||
|
// modelValue变了 更新 filterText的值
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => (filterText.value = val)
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user