Browse Source

perf: 优化 `RePureTableBar` 组件的 `buttons` 具名插槽

xiaoxian521 2 years ago
parent
commit
151592c660
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/components/RePureTableBar/src/bar.tsx

+ 3 - 1
src/components/RePureTableBar/src/bar.tsx

@@ -110,7 +110,9 @@ export default defineComponent({
           <div class="flex justify-between w-full h-[60px] p-4">
             <p class="font-bold truncate">{props.title}</p>
             <div class="flex items-center justify-around">
-              <div class="flex mr-4">{slots?.buttons()}</div>
+              {slots?.buttons ? (
+                <div class="flex mr-4">{slots.buttons()}</div>
+              ) : null}
               {props.tableRef?.size ? (
                 <>
                   <el-tooltip