Browse Source

protable 查询显示判断修改

tongshangming 2 years ago
parent
commit
68c8d7162b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/components/ProTable.vue

+ 3 - 1
src/components/ProTable.vue

@@ -37,6 +37,8 @@ const props = withDefaults(defineProps<Props>(), {
 
 const emits = defineEmits(['click-create', 'click-edit'])
 
+const slots = useSlots()
+
 // ============== 查询部分开始 ===============
 const query = ref<any>({})
 const searchList = ref<any>([])
@@ -204,7 +206,7 @@ defineExpose({
 
 <template>
   <div class="flex flex-col" :style="{ height: height || 'calc(100vh - 101px - var(--main-padding) * 2)' }">
-    <el-card class="mb-4" shadow="never" v-if="searchList.length">
+    <el-card class="mb-4" shadow="never" v-if="searchList.length || slots.query">
       <el-form :inline="true">
         <el-form-item :label="item.label" v-for="(item, index) in searchList" :key="index">
           <form-comp :item="item" v-model="query[item.name]"></form-comp>