Kaynağa Gözat

Merge branch 'next' of https://gitee.com/zuohuaijun/Admin.NET into next

zuohuaijun 2 yıl önce
ebeveyn
işleme
b9cddcc516
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  1. 6 2
      Web/src/components/table/search.vue

+ 6 - 2
Web/src/components/table/search.vue

@@ -105,7 +105,7 @@
 </template>
 
 <script setup lang="ts" name="makeTableDemoSearch">
-import { reactive, ref } from 'vue';
+import { reactive, ref, toRefs } from 'vue';
 import type { FormInstance } from 'element-plus';
 import { saulVModel } from '/@/utils/saulVModel';
 
@@ -129,7 +129,11 @@ const props = defineProps({
 
 // 定义子组件向父组件传值/事件
 const emit = defineEmits(['search', 'reset', 'update:modelValue']);
-const searchModel = ref(props.modelValue);
+
+// 将 props中的值转为 ref
+const refProps = toRefs(props);
+const searchModel = refProps.modelValue;
+
 // 定义变量内容
 const tableSearchRef = ref<FormInstance>();
 const state = reactive({