瀏覽代碼

Merge remote-tracking branch 'yudao/master'

puhui999 2 年之前
父節點
當前提交
585a667352
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/components/Search/src/Search.vue

+ 3 - 3
src/components/Search/src/Search.vue

@@ -9,8 +9,6 @@ import { FormSchema } from '@/types/form'
 
 const { t } = useI18n()
 
-const slots = useSlots()
-
 const props = defineProps({
   // 生成Form的布局结构数组
   schema: {
@@ -125,7 +123,9 @@ const setVisible = () => {
         </ElButton>
       </div>
     </template>
-    <template v-for="(slot, name) in slots" #[name]><slot :name="name"></slot></template>
+    <template #[name] v-for="name in Object.keys($slots)" :key="name"
+      ><slot :name="name"></slot
+    ></template>
   </Form>
 
   <template v-if="layout === 'bottom'">