瀏覽代碼

no message

xiaochan 1 年之前
父節點
當前提交
9f4a474676
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      src/components/cy/flex/src/CyFlex.vue

+ 11 - 2
src/components/cy/flex/src/CyFlex.vue

@@ -6,10 +6,10 @@
     <div>
       <slot name="header"/>
     </div>
-    <div style="flex: 1; height: 0 ;overflow: auto" ref="contentRef" v-if="slots.content">
+    <div :style="style" ref="contentRef" v-if="slots.content">
       <slot name="content" :height="height" :width="width"/>
     </div>
-    <div style="flex: 1; height: 0 ;overflow: auto" ref="contentRef" v-if="slots.default">
+    <div :style="style" ref="contentRef" v-if="slots.default">
       <slot name="default" :height="height" :width="width"/>
     </div>
   </div>
@@ -36,4 +36,13 @@ const slots = useSlots()
 const contentRef = ref()
 const {height, width} = useElementSize(props.contentSize ? contentRef : null)
 
+const style = computed(() => {
+  return {
+    flex: 1,
+    height: props.tabPosition === 'transverse' ? 0 : '100%',
+    width: props.tabPosition === 'transverse' ? '100%' : 0,
+    overflow: 'auto'
+  }
+})
+
 </script>