Skip to content

Commit

Permalink
fix(ui/tabs): support nuxt3
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Jan 25, 2022
1 parent ae07f8d commit 9459d1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/varlet-ui/src/tabs/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { defineComponent, watch, ref, computed, Transition, nextTick, onMounted,
import { props } from './props'
import { useTabList } from './provide'
import { isNumber, linear } from '../utils/shared'
import { toSizeUnit, scrollTo } from '../utils/elements'
import { toSizeUnit, scrollTo, doubleRaf } from '../utils/elements'
import type { Ref, ComputedRef } from 'vue'
import type { TabsProvider } from './provide'
import type { TabProvider } from '../tab/provide'
Expand Down Expand Up @@ -164,7 +164,10 @@ export default defineComponent({
watch(
() => length.value,
() => nextTick().then(resize)
async () => {
await doubleRaf()
resize()
}
)
watch(() => props.active, resize)
Expand Down
1 change: 1 addition & 0 deletions packages/varlet-ui/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ declare module 'vue' {
VarRipple: typeof import('@varlet/ui')['_RippleComponent']
VarRow: typeof import('@varlet/ui')['_RowComponent']
VarSelect: typeof import('@varlet/ui')['_SelectComponent']
VarSkeleton: typeof import('@varlet/ui')['_SkeletonComponent']
VarSlider: typeof import('@varlet/ui')['_SliderComponent']
VarSnackbar: typeof import('@varlet/ui')['_SnackbarComponent']
VarSpace: typeof import('@varlet/ui')['_SpaceComponent']
Expand Down
1 change: 1 addition & 0 deletions packages/varlet-ui/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export * from './rate'
export * from './ripple'
export * from './row'
export * from './select'
export * from './skeleton'
export * from './slider'
export * from './snackbar'
export * from './space'
Expand Down

0 comments on commit 9459d1d

Please sign in to comment.