소스 검색

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>