Repository: Tencent/tdesign-mobile-vue (ts)

Issue:
【TabBar】测试覆盖率提升
> 目前正在推进 mobile-vue 的组件测试覆盖率提升。

## 任务要求
- **行覆盖率达 80%+**
- **分支覆盖率 80%+**
- **语句覆盖率 80%+**
- 有交互的组件，需要覆盖所有场景，**要求函数覆盖率 80+%**

## 单元测试指引
 [mobile-vue 的单元测试指引文档](https://github.com/Tencent/tdesign-mobile-vue/wiki/mobile-vue%EF%BC%9A%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E6%8C%87%E5%BC%95)

> **目前每个组件都拥有自己的测试用例文件，我们可以先通过`npm run test:unit-coverage`生成测试覆盖率报告，查看该组件的单元测试覆盖率情况，然后针对性的补充测试用例**

#### Tips
- Vitest 单元测试框架：[文档](https://cn.vitest.dev/guide/)
- 若开发工具为 vscode ，可以安装 Vitest 插件

## 激励

参与共建的开发者，将可以获得 [TDesign 周边](https://github.com/Tencent/tdesign/wiki/TDesign-%E5%91%A8%E8%BE%B9)（贴纸、鼠标垫、工卡套等）；

成为核心贡献者，将会拥有 TDesign 专属头像。

## IssueShoot
- 预估时长: 1
- 期望完成时间: 2023-05-29 00:00:00 +0000 UTC
- 开发难度: 低
- 参与人数: 1
- 验收标准: 实现期望改造效果，提 PR 并通过验收无误
- 备注: 最终激励以实际提交 `pull request` 并合并为准

Pull request:
test(tab-bar): improve test coverage
<!--
首先，感谢你的贡献！😄
请阅读并遵循 [TDesign 贡献指南](https://github.com/Tencent/tdesign/blob/main/docs/contributing.md)，填写以下 pull request 的信息。
PR 在维护者审核通过后会合并，谢谢！
-->

### 🤔 这个 PR 的性质是？

- [ ] 日常 bug 修复
- [ ] 新特性提交
- [ ] 文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] CI/CD 改进
- [ ] 重构
- [ ] 代码风格优化
- [x] 测试用例
- [ ] 分支合并
- [ ] 其他

### 🔗 相关 Issue

<!--
1. 描述相关需求的来源，如相关的 issue 讨论链接。
-->
fix #733

### 💡 需求背景和解决方案

<!--
1. 要解决的具体问题。
2. 列出最终的 API 实现和用法。
3. 涉及UI/交互变动需要有截图或 GIF。
-->
提升测试覆盖率

### 📝 更新日志

<!--
从用户角度描述具体变化，以及可能的 breaking change 和其他风险。
-->

- other(TabBar): 补充测试用例

- [ ] 本条 PR 不需要纳入 Changelog

### ☑️ 请求合并前的自查清单

⚠️ 请自检并全部**勾选全部选项**。⚠️

- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] Changelog 已提供或无须提供


Patch:
diff --git a/src/action-sheet/action-sheet-grid.vue b/src/action-sheet/action-sheet-grid.vue
index fc3ec3e5..906ff4bb 100644
--- a/src/action-sheet/action-sheet-grid.vue
+++ b/src/action-sheet/action-sheet-grid.vue
@@ -7,6 +7,7 @@
       :navigation="{ type: 'dots', showControls: false }"
       :loop="false"
       :class="`${name}__swiper-wrap`"
+      height="192"
     >
       <t-swiper-item v-for="(Items, i) in actionItems" :key="i">
         <t-grid :column="gridColumn">
diff --git a/src/image-viewer/image-viewer.vue b/src/image-viewer/image-viewer.vue
index 3bf15348..2b889956 100644
--- a/src/image-viewer/image-viewer.vue
+++ b/src/image-viewer/image-viewer.vue
@@ -13,7 +13,13 @@
           <t-node :content="deleteNode" />
         </div>
       </div>
-      <t-swiper :autoplay="false" :class="`${name}__content`" :current="currentIndex" @change="onSwiperChange">
+      <t-swiper
+        :autoplay="false"
+        :class="`${name}__content`"
+        height="100vh"
+        :current="currentIndex"
+        @change="onSwiperChange"
+      >
         <t-swiper-item
           v-for="(image, index) in images"
           :key="index"
@@ -30,7 +36,7 @@
 </template>
 
 <script lang="ts">
-import { computed, defineComponent, reactive, getCurrentInstance, CSSProperties, h, Transition } from 'vue';
+import { computed, defineComponent, reactive, getCurrentInstance, CSSProperties, h, Transition, toRefs } from 'vue';
 import { CloseIcon, DeleteIcon } from 'tdesign-icons-vue-next';
 
 import config from '../config';
@@ -64,6 +70,7 @@ export default defineComponent({
     const state = reactive({
       zooming: false,
       scale: 1,
+      swiperStyle: [] as string[],
     });
     const emitEvent = useEmitEvent(props, context.emit);
     const [visible, setVisible] = useDefault(props, context.emit, 'visible', 'change');
@@ -219,6 +226,7 @@ export default defineComponent({
 
     return {
       name,
+      ...toRefs(state),
       prefix,
       closeNode,
       deleteNode,
diff --git a/src/swiper/demos/base.vue b/src/swiper/demos/base.vue
index 1e3e13da..2015c916 100644
--- a/src/swiper/demos/base.vue
+++ b/src/swiper/demos/base.vue
@@ -1,7 +1,7 @@
 <template>
   <div style="padding: 0 16px">
     <t-swiper :navigation="{ type: 'dots' }" :autoplay="false" @change="handleChange">
-      <t-swiper-item v-for="(item, index) in swiperList" :key="index">
+      <t-swiper-item v-for="(item, index) in swiperList" :key="index" style="height: 192px">
         <img :src="item" class="img" />
       </t-swiper-item>
     </t-swiper>
diff --git a/src/swiper/demos/control.vue b/src/swiper/demos/control.vue
index bcb7251c..cd1b2372 100644
--- a/src/swiper/demos/control.vue
+++ b/src/swiper/demos/control.vue
@@ -3,6 +3,7 @@
     <t-swiper
       :autoplay="true"
       :navigation="{ showControls: true, paginationPosition: 'bottom-right' }"
+      height="192"
       @change="handleChange"
     >
       <t-swiper-item v-for="(item, index) in swiperList" :key="index">
diff --git a/src/swiper/demos/custom.vue b/src/swiper/demos/custom.vue
index 27207dff..3e6ff3dd 100644
--- a/src/swiper/demos/custom.vue
+++ b/src/swiper/demos/custom.vue
@@ -1,6 +1,6 @@
 <template>
   <div style="padding: 0 16px">
-    <t-swiper :autoplay="true" :navigation="{ type: 'dots-bar' }" @change="handleChange">
+    <t-swiper :autoplay="true" height="192" :navigation="{ type: 'dots-bar' }" @change="handleChange">
       <t-swiper-item v-for="(item, index) in swiperList" :key="index">
         <img :src="item" class="img" />
       </t-swiper-item>
diff --git a/src/swiper/demos/fraction.vue b/src/swiper/demos/fraction.vue
index 338c0edf..580ae441 100644
--- a/src/swiper/demos/fraction.vue
+++ b/src/swiper/demos/fraction.vue
@@ -5,7 +5,7 @@
       :navigation="{ type: 'fraction', paginationPosition: 'bottom-right' }"
       @change="handleChange"
     >
-      <t-swiper-item v-for="(item, index) in swiperList" :key="index">
+      <t-swiper-item v-for="(item, index) in swiperList" :key="index" style="height: 192px">
         <img :src="item" class="img" />
       </t-swiper-item>
     </t-swiper>
diff --git a/src/swiper/props.ts b/src/swiper/props.ts
index 1496de62..818c45af 100644
--- a/src/swiper/props.ts
+++ b/src/swiper/props.ts
@@ -52,7 +52,7 @@ export default {
   },
   /** 当使用垂直方向滚动时的高度 */
   height: {
-    type: Number,
+    type: [String, Number] as PropType<TdSwiperProps['height']>,
   },
   /** 轮播间隔时间 */
   interval: {
diff --git a/src/swiper/swiper-item.vue b/src/swiper/swiper-item.vue
index f318c291..12c2a32b 100644
--- a/src/swiper/swiper-item.vue
+++ b/src/swiper/swiper-item.vue
@@ -1,11 +1,13 @@
 <template>
-  <div :class="name" :style="rootStyle">
+  <div ref="selfRef" :class="name" :style="rootStyle">
     <slot />
   </div>
 </template>
 
 <script lang="ts">
-import { ref, inject, computed, getCurrentInstance, onMounted, onUnmounted } from 'vue';
+import { ref, inject, computed, getCurrentInstance, onMounted, onUnmounted, watch } from 'vue';
+import { useElementBounding } from '@vueuse/core';
+
 import config from '../config';
 
 const { prefix } = config;
@@ -17,7 +19,8 @@ export default {
 </script>
 
 <script lang="ts" setup>
-const { addChild, removeChild, isVertical, root, loop, items } = inject('parent') as any;
+const { addChild, removeChild, isVertical, root, loop, items, setContainerHeight } = inject('parent') as any;
+const selfRef = ref(null);
 const rootStyle = ref('');
 const instance = getCurrentInstance();
 
@@ -34,9 +37,15 @@ const calcTranslateStyle = (index: number, activeIndex: number) => {
 
   rootStyle.value = `transform: translate${direction.value}(${step * distance}px)`;
 };
+const { height } = useElementBounding(selfRef);
+
+watch(height, (val) => {
+  setContainerHeight(val);
+});
 
 onMounted(() => {
   addChild({
+    proxy: instance?.proxy,
     uid: instance?.uid,
     calcTranslateStyle,
   });
diff --git a/src/swiper/swiper.en-US.md b/src/swiper/swiper.en-US.md
index 81d83f0b..1cddabc4 100644
--- a/src/swiper/swiper.en-US.md
+++ b/src/swiper/swiper.en-US.md
@@ -10,7 +10,7 @@ autoplay | Boolean | true | \- | N
 current | Number | 0 | `v-model` and `v-model:current` is supported | N
 direction | String | horizontal | options：horizontal/vertical | N
 duration | Number | 300 | \- | N
-height | Number | - | \- | N
+height | Number / String | - | \- | N
 interval | Number | 5000 | \- | N
 loop | Boolean | true | \- | N
 navigation | Object / Slot / Function | - | Typescript：`SwiperNavigation \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
diff --git a/src/swiper/swiper.md b/src/swiper/swiper.md
index 2418011a..6b789b96 100644
--- a/src/swiper/swiper.md
+++ b/src/swiper/swiper.md
@@ -10,7 +10,7 @@ autoplay | Boolean | true | 是否自动播放 | N
 current | Number | 0 | 当前轮播在哪一项（下标）。支持语法糖 `v-model` 或 `v-model:current` | N
 direction | String | horizontal | 轮播滑动方向，包括横向滑动和纵向滑动两个方向。可选项：horizontal/vertical | N
 duration | Number | 300 | 滑动动画时长 | N
-height | Number | - | 当使用垂直方向滚动时的高度 | N
+height | Number / String | - | 轮播的高度 | N
 interval | Number | 5000 | 轮播间隔时间 | N
 loop | Boolean | true | 是否循环播放 | N
 navigation | Object / Slot / Function | - | 导航器全部配置。TS 类型：`SwiperNavigation \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
diff --git a/src/swiper/swiper.vue b/src/swiper/swiper.vue
index f5182589..bdc80fd4 100644
--- a/src/swiper/swiper.vue
+++ b/src/swiper/swiper.vue
@@ -1,5 +1,5 @@
 <template>
-  <div ref="root" :class="rootClass" :style="{ height: swiperHeight }">
+  <div ref="root" :class="rootClass">
     <div
       ref="swiperContainer"
       :class="`${name}__container`"
@@ -7,6 +7,7 @@
         flexDirection: !isVertical ? 'row' : 'column',
         transition: animating ? `transform ${duration}ms` : 'none',
         transform: translateContainer,
+        height: containerHeight,
       }"
       @transitionend="handleAnimationEnd"
       @click="onItemClick"
@@ -50,9 +51,10 @@
 </template>
 
 <script lang="ts">
-import { getCurrentInstance, onMounted, computed, ref, provide, defineEmits, defineProps } from 'vue';
+import { getCurrentInstance, onMounted, computed, ref, provide, defineEmits, defineProps, watch } from 'vue';
 import { useSwipe } from '@vueuse/core';
 import isObject from 'lodash/isObject';
+import { isNumber } from 'lodash';
 
 import config from '../config';
 import SwiperProps from './props';
@@ -94,12 +96,7 @@ const disabled = ref(false);
 const translateContainer = ref('');
 
 const isVertical = computed(() => props.direction === 'vertical');
-const swiperHeight = computed(() => {
-  if (isVertical.value && props.height) {
-    return `${props.height}px`;
-  }
-  return '192px';
-});
+const containerHeight = ref('auto');
 
 const rootClass = computed(() => {
   return [`${name}`, `${name}--${props.type}`];
@@ -232,6 +229,22 @@ const updateItemPosition = () => {
   });
 };
 
+const setContainerHeight = (height: number | string) =>
+  (containerHeight.value = isNumber(height) ? `${height}px` : height);
+
+const updateContainerHeight = () => {
+  const target = items.value[current.value ?? 0];
+  const rect = target?.proxy?.$el.getBoundingClientRect();
+
+  if (props.height) {
+    setContainerHeight(props.height);
+  } else if (rect) {
+    setContainerHeight(rect.height);
+  }
+};
+
+watch(current, updateContainerHeight);
+
 provide('parent', {
   loop: props.loop,
   root,
@@ -239,10 +252,12 @@ provide('parent', {
   isVertical,
   addChild,
   removeChild,
+  setContainerHeight,
 });
 
 onMounted(() => {
   startAutoplay();
   updateItemPosition();
+  updateContainerHeight();
 });
 </script>
diff --git a/src/swiper/type.ts b/src/swiper/type.ts
index 0baa31e6..5338c10e 100644
--- a/src/swiper/type.ts
+++ b/src/swiper/type.ts
@@ -45,7 +45,7 @@ export interface TdSwiperProps {
   /**
    * 当使用垂直方向滚动时的高度
    */
-  height?: number;
+  height?: number | string;
   /**
    * 轮播间隔时间
    * @default 5000
diff --git a/src/textarea/textarea.vue b/src/textarea/textarea.vue
index f26b2206..cc5c8828 100644
--- a/src/textarea/textarea.vue
+++ b/src/textarea/textarea.vue
@@ -26,7 +26,7 @@
 </template>
 
 <script lang="ts">
-import { computed, ref, onMounted, defineComponent, getCurrentInstance, toRefs, nextTick } from 'vue';
+import { computed, ref, onMounted, defineComponent, getCurrentInstance, toRefs, nextTick, watch } from 'vue';
 import { useEmitEvent, renderTNode, TNode, getCharacterLength, useVModel } from '../shared';
 import config from '../config';
 import TextareaProps from './props';
@@ -137,6 +137,11 @@ export default defineComponent({
       adjustTextareaHeight();
     });
 
+    watch(innerValue, () => {
+      nextTick(() => {
+        adjustTextareaHeight();
+      });
+    });
     return {
       componentName,
       ...toRefs(props),


Test patch:
diff --git a/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap b/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap
index 181f9c6f..629d937a 100644
--- a/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap
@@ -395,11 +395,10 @@ exports[`ActionSheet > ActionSheet gridMultipleVue demo works fine 1`] = `
           <div
             class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
             pagination-position="bottom"
-            style="height: 192px;"
           >
             <div
               class="t-swiper__container"
-              style="flex-direction: row; transition: none;"
+              style="flex-direction: row; transition: none; height: auto;"
             >
               
               
@@ -1083,11 +1082,11 @@ exports[`ActionSheet > ActionSheet gridVue demo works fine 1`] = `
           <div
             class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
             pagination-position="bottom"
-            style="height: 192px; display: none;"
+            style="display: none;"
           >
             <div
               class="t-swiper__container"
-              style="flex-direction: row; transition: none;"
+              style="flex-direction: row; transition: none; height: auto;"
             >
               
               
@@ -2035,11 +2034,11 @@ exports[`ActionSheet > ActionSheet gridVue demo works fine 1`] = `
           <div
             class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
             pagination-position="bottom"
-            style="height: 192px; display: none;"
+            style="display: none;"
           >
             <div
               class="t-swiper__container"
-              style="flex-direction: row; transition: none;"
+              style="flex-direction: row; transition: none; height: auto;"
             >
               
               
@@ -2987,11 +2986,11 @@ exports[`ActionSheet > ActionSheet gridVue demo works fine 1`] = `
           <div
             class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
             pagination-position="bottom"
-            style="height: 192px; display: none;"
+            style="display: none;"
           >
             <div
               class="t-swiper__container"
-              style="flex-direction: row; transition: none;"
+              style="flex-direction: row; transition: none; height: auto;"
             >
               
               
@@ -5779,11 +5778,11 @@ exports[`ActionSheet > ActionSheet mobileVue demo works fine 1`] = `
               <div
                 class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
                 pagination-position="bottom"
-                style="height: 192px; display: none;"
+                style="display: none;"
               >
                 <div
                   class="t-swiper__container"
-                  style="flex-direction: row; transition: none;"
+                  style="flex-direction: row; transition: none; height: auto;"
                 >
                   
                   
@@ -6731,11 +6730,11 @@ exports[`ActionSheet > ActionSheet mobileVue demo works fine 1`] = `
               <div
                 class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
                 pagination-position="bottom"
-                style="height: 192px; display: none;"
+                style="display: none;"
               >
                 <div
                   class="t-swiper__container"
-                  style="flex-direction: row; transition: none;"
+                  style="flex-direction: row; transition: none; height: auto;"
                 >
                   
                   
@@ -7683,11 +7682,11 @@ exports[`ActionSheet > ActionSheet mobileVue demo works fine 1`] = `
               <div
                 class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
                 pagination-position="bottom"
-                style="height: 192px; display: none;"
+                style="display: none;"
               >
                 <div
                   class="t-swiper__container"
-                  style="flex-direction: row; transition: none;"
+                  style="flex-direction: row; transition: none; height: auto;"
                 >
                   
                   
@@ -8799,11 +8798,10 @@ exports[`ActionSheet > ActionSheet mobileVue demo works fine 1`] = `
               <div
                 class="t-swiper t-swiper--default t-action-sheet__swiper-wrap"
                 pagination-position="bottom"
-                style="height: 192px;"
               >
                 <div
                   class="t-swiper__container"
-                  style="flex-direction: row; transition: none;"
+                  style="flex-direction: row; transition: none; height: auto;"
                 >
                   
                   
diff --git a/src/notice-bar/__test__/__snapshots__/demo.test.jsx.snap b/src/notice-bar/__test__/__snapshots__/demo.test.jsx.snap
index f42f2786..cb8880a7 100644
--- a/src/notice-bar/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/notice-bar/__test__/__snapshots__/demo.test.jsx.snap
@@ -1204,11 +1204,10 @@ exports[`NoticeBar > NoticeBar mobileVue demo works fine 1`] = `
           <div>
             <div
               class="t-swiper t-swiper--default t-notice-bar__content--vertical"
-              style="height: 22px;"
             >
               <div
                 class="t-swiper__container"
-                style="flex-direction: column; transition: none;"
+                style="flex-direction: column; transition: none; height: auto;"
               >
                 
                 
@@ -1398,11 +1397,10 @@ exports[`NoticeBar > NoticeBar scrollingVue demo works fine 1`] = `
       <div>
         <div
           class="t-swiper t-swiper--default t-notice-bar__content--vertical"
-          style="height: 22px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: column; transition: none;"
+            style="flex-direction: column; transition: none; height: auto;"
           >
             
             
diff --git a/src/swiper/__test__/__snapshots__/demo.test.jsx.snap b/src/swiper/__test__/__snapshots__/demo.test.jsx.snap
index cd52b2ee..11d69d21 100644
--- a/src/swiper/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/swiper/__test__/__snapshots__/demo.test.jsx.snap
@@ -6,17 +6,16 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
 >
   <div
     class="t-swiper t-swiper--default"
-    style="height: 192px;"
   >
     <div
       class="t-swiper__container"
-      style="flex-direction: row; transition: none;"
+      style="flex-direction: row; transition: none; height: auto;"
     >
       
       
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -27,7 +26,7 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -38,7 +37,7 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -49,7 +48,7 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -60,7 +59,7 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -90,11 +89,10 @@ exports[`Swiper > Swiper baseVue demo works fine 1`] = `
 exports[`Swiper > Swiper cardVue demo works fine 1`] = `
 <div
   class="t-swiper t-swiper--card"
-  style="height: 192px;"
 >
   <div
     class="t-swiper__container"
-    style="flex-direction: row; transition: none;"
+    style="flex-direction: row; transition: none; height: auto;"
   >
     
     
@@ -176,11 +174,10 @@ exports[`Swiper > Swiper controlVue demo works fine 1`] = `
 >
   <div
     class="t-swiper t-swiper--default"
-    style="height: 192px;"
   >
     <div
       class="t-swiper__container"
-      style="flex-direction: row; transition: none;"
+      style="flex-direction: row; transition: none; height: auto;"
     >
       
       
@@ -266,11 +263,10 @@ exports[`Swiper > Swiper customVue demo works fine 1`] = `
 >
   <div
     class="t-swiper t-swiper--default"
-    style="height: 192px;"
   >
     <div
       class="t-swiper__container"
-      style="flex-direction: row; transition: none;"
+      style="flex-direction: row; transition: none; height: auto;"
     >
       
       
@@ -353,17 +349,16 @@ exports[`Swiper > Swiper fractionVue demo works fine 1`] = `
 >
   <div
     class="t-swiper t-swiper--default"
-    style="height: 192px;"
   >
     <div
       class="t-swiper__container"
-      style="flex-direction: row; transition: none;"
+      style="flex-direction: row; transition: none; height: auto;"
     >
       
       
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -374,7 +369,7 @@ exports[`Swiper > Swiper fractionVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -385,7 +380,7 @@ exports[`Swiper > Swiper fractionVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -396,7 +391,7 @@ exports[`Swiper > Swiper fractionVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -407,7 +402,7 @@ exports[`Swiper > Swiper fractionVue demo works fine 1`] = `
       </div>
       <div
         class="t-swiper-item"
-        style=""
+        style="height: 192px;"
       >
         
         <img
@@ -475,17 +470,16 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
       >
         <div
           class="t-swiper t-swiper--default"
-          style="height: 192px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: row; transition: none;"
+            style="flex-direction: row; transition: none; height: auto;"
           >
             
             
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -496,7 +490,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -507,7 +501,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -518,7 +512,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -529,7 +523,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -579,11 +573,10 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
       >
         <div
           class="t-swiper t-swiper--default"
-          style="height: 192px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: row; transition: none;"
+            style="flex-direction: row; transition: none; height: auto;"
           >
             
             
@@ -683,17 +676,16 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
       >
         <div
           class="t-swiper t-swiper--default"
-          style="height: 192px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: row; transition: none;"
+            style="flex-direction: row; transition: none; height: auto;"
           >
             
             
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -704,7 +696,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -715,7 +707,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -726,7 +718,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -737,7 +729,7 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
             </div>
             <div
               class="t-swiper-item"
-              style=""
+              style="height: 192px;"
             >
               
               <img
@@ -788,11 +780,10 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
       >
         <div
           class="t-swiper t-swiper--default"
-          style="height: 192px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: row; transition: none;"
+            style="flex-direction: row; transition: none; height: auto;"
           >
             
             
@@ -902,11 +893,10 @@ exports[`Swiper > Swiper mobileVue demo works fine 1`] = `
       >
         <div
           class="t-swiper t-swiper--default"
-          style="height: 192px;"
         >
           <div
             class="t-swiper__container"
-            style="flex-direction: column; transition: none;"
+            style="flex-direction: column; transition: none; height: auto;"
           >
             
             
@@ -993,11 +983,10 @@ exports[`Swiper > Swiper verticalVue demo works fine 1`] = `
 >
   <div
     class="t-swiper t-swiper--default"
-    style="height: 192px;"
   >
     <div
       class="t-swiper__container"
-      style="flex-direction: column; transition: none;"
+      style="flex-direction: column; transition: none; height: auto;"
     >
       
       
diff --git a/src/swiper/__test__/__snapshots__/index.test.jsx.snap b/src/swiper/__test__/__snapshots__/index.test.jsx.snap
index 5178bf53..ecaf8b2c 100644
--- a/src/swiper/__test__/__snapshots__/index.test.jsx.snap
+++ b/src/swiper/__test__/__snapshots__/index.test.jsx.snap
@@ -3,11 +3,10 @@
 exports[`swiper > height & direction 1`] = `
 <div
   class="t-swiper t-swiper--default"
-  style="height: 200px;"
 >
   <div
     class="t-swiper__container"
-    style="flex-direction: column; transition: transform 100ms; transform: translateY(0px);"
+    style="flex-direction: column; transition: transform 100ms; height: 200px; transform: translateY(0px);"
   >
     
     
diff --git a/src/swiper/__test__/index.test.jsx b/src/swiper/__test__/index.test.jsx
index 39e03579..d87f901c 100644
--- a/src/swiper/__test__/index.test.jsx
+++ b/src/swiper/__test__/index.test.jsx
@@ -127,17 +127,16 @@ describe('swiper', () => {
     });
     await sleep(interval + duration);
     expect(wrapper.element).toMatchSnapshot();
-    const $swiper = wrapper.find(`.${classPrefix}`);
+    // const $swiper = wrapper.find(`.${classPrefix}`);
     const $swiperContainer = wrapper.find(`.${classPrefix}__container`);
     $swiperContainer.trigger(`transitionend`);
-    expect(
-      $swiperContainer
-        .attributes('style')
-        .includes(`flex-direction: column; transform: translateY(-${height * (1 + current.value)}px);`),
-    );
+    // expect(
+    //   $swiperContainer
+    //     .attributes('style')
+    //     .includes(`flex-direction: column; transform: translateY(-${height * (1 + current.value)}px);`),
+    // );
 
     // height = 200
-    expect($swiper.attributes('style').includes(`height: ${height}px;`));
     expect($swiperContainer.attributes('style').includes(`height: ${height}px;`));
 
     // 导航器 dots-bar
diff --git a/src/tab-bar/__test__/index.test.jsx b/src/tab-bar/__test__/index.test.jsx
index a3c517a5..6727af8f 100644
--- a/src/tab-bar/__test__/index.test.jsx
+++ b/src/tab-bar/__test__/index.test.jsx
@@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest';
 import { mount } from '@vue/test-utils';
 import TabBar from '../tab-bar.vue';
 import TabBarItem from '../tab-bar-item.vue';
-import { nextTick, ref } from 'vue';
+import { ref } from 'vue';
 
 const list = [
   {
@@ -87,23 +87,22 @@ describe('TabBar', () => {
       ).toEqual('标签二');
     });
 
-    // it('snapshot', () => {
-    //   const icon = () => <TIconApp />;
-    //   const wrapper = mount({
-    //     render: () => (
-    //       <TabBar>
-    //         {list.map((item) => {
-    //           return <TabBarItem {...item} icon={icon} badgeProps={{ count: 1 }} />;
-    //         })}
-    //       </TabBar>
-    //     ),
-    //   });
-    //   expect(wrapper.element).toMatchSnapshot();
-    // });
+    it('item without value', async () => {
+      const wrapper = mount({
+        render() {
+          return <TabBar value={0}>
+            <TabBarItem></TabBarItem>
+          </TabBar>
+        }
+      })
+
+      const item = wrapper.findComponent('.t-tab-bar-item');
+      expect(item.vm.isChecked).toBeTruthy();
+    })
   });
 
   describe('events', () => {
-    it('click to change', async () => {
+    it('click', async () => {
       const onChange = vi.fn();
       const value = ref('1');
       const wrapper = mount({