|
@@ -1,5 +1,5 @@
|
|
|
<script setup>
|
|
|
-import { computed, ref } from "vue";
|
|
|
+import { computed, ref, watch } from "vue";
|
|
|
const props=defineProps({
|
|
|
defaultVal:{
|
|
|
type:String,
|
|
@@ -43,6 +43,13 @@ const handleSearch = ()=>{
|
|
|
}
|
|
|
emit('search',searchData.value)
|
|
|
}
|
|
|
+
|
|
|
+watch(
|
|
|
+ ()=>props.defaultVal,
|
|
|
+ ()=>{
|
|
|
+ searchData.value=props.defaultVal
|
|
|
+ }
|
|
|
+)
|
|
|
</script>
|
|
|
<template>
|
|
|
<div :class="['search-wrap',(isFocus||searchData)&&'focus']">
|