xiaochan hai 1 ano
pai
achega
9f4a474676
Modificáronse 1 ficheiros con 11 adicións e 2 borrados
  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>