fix(tab): jest change

This commit is contained in:
johnsonwong666 2023-04-24 19:32:45 +08:00
parent 9e6832bf85
commit 747b30597a
6 changed files with 31 additions and 35 deletions

View File

@ -56,7 +56,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onChange" bind:change="onChange"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -70,7 +70,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"

View File

@ -6,7 +6,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onSwitch" bind:change="onSwitch"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -20,7 +20,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"

View File

@ -6,7 +6,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onChange" bind:change="onChange"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -20,7 +20,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"

View File

@ -15,7 +15,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onChange" bind:change="onChange"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -29,7 +29,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -172,7 +172,7 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view> </wx-view>
<van-tabs> <van-tabs>
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -186,7 +186,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -308,7 +308,7 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view> </wx-view>
<van-tabs> <van-tabs>
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -322,7 +322,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap van-tabs__wrap--scrollable wrap-class" class="van-tabs--line van-tabs__wrap van-tabs__wrap--scrollable wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -509,7 +509,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:disabled="onClickDisabled" bind:disabled="onClickDisabled"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -523,7 +523,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -647,7 +647,7 @@ exports[`should render demo and match snapshot 1`] = `
tabClass="special-tab" tabClass="special-tab"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--card" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -661,7 +661,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--card van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--card" class="van-tabs__scroll van-tabs__scroll--card"
@ -781,7 +781,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:click="onClick" bind:click="onClick"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -795,7 +795,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -896,7 +896,7 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view> </wx-view>
<van-tabs> <van-tabs>
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -910,7 +910,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -1053,7 +1053,7 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view> </wx-view>
<van-tabs> <van-tabs>
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -1067,7 +1067,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -1210,7 +1210,7 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view> </wx-view>
<van-tabs> <van-tabs>
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -1224,7 +1224,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -1371,7 +1371,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onChange" bind:change="onChange"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -1385,7 +1385,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"
@ -1562,7 +1562,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:change="onChange" bind:change="onChange"
> >
<wx-view <wx-view
class="custom-class van-tabs van-tabs--line" class="custom-class van-tabs"
> >
<van-sticky <van-sticky
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
@ -1576,7 +1576,7 @@ exports[`should render demo and match snapshot 1`] = `
style="z-index:1" style="z-index:1"
> >
<wx-view <wx-view
class="van-tabs__wrap wrap-class" class="van-tabs--line van-tabs__wrap wrap-class"
> >
<wx-scroll-view <wx-scroll-view
class="van-tabs__scroll van-tabs__scroll--line" class="van-tabs__scroll van-tabs__scroll--line"

View File

@ -113,16 +113,12 @@
} }
&--line { &--line {
.van-tabs__wrap {
height: var(--tabs-line-height, @tabs-line-height); height: var(--tabs-line-height, @tabs-line-height);
} }
}
&--card { &--card {
.van-tabs__wrap {
height: var(--tabs-card-height, @tabs-card-height); height: var(--tabs-card-height, @tabs-card-height);
} }
}
} }
.van-tab { .van-tab {

View File

@ -9,7 +9,7 @@
container="{{ container }}" container="{{ container }}"
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
> >
<view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }} {{ 'van-tabs--' + type }} wrap-class"> <view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }} wrap-class">
<slot name="nav-left" /> <slot name="nav-left" />
<scroll-view <scroll-view