mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-26 00:09:15 +08:00
fix(Tabs): incorrect active tab when active prop is zero (#8074)
Co-authored-by: songpeng01 <songpeng01@mail.open.com.cn>
This commit is contained in:
parent
9735369e99
commit
7b94ac9199
@ -372,7 +372,7 @@ export default createComponent({
|
|||||||
() => children.length,
|
() => children.length,
|
||||||
() => {
|
() => {
|
||||||
if (state.inited) {
|
if (state.inited) {
|
||||||
setCurrentIndexByName(props.active || currentName.value);
|
setCurrentIndexByName((props.active || props.active === 0) ? props.active : currentName.value);
|
||||||
setLine();
|
setLine();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollIntoView(true);
|
scrollIntoView(true);
|
||||||
@ -397,7 +397,7 @@ export default createComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
setCurrentIndexByName(props.active || currentName.value);
|
setCurrentIndexByName((props.active || props.active === 0) ? props.active : currentName.value);
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
state.inited = true;
|
state.inited = true;
|
||||||
tabHeight = getVisibleHeight(wrapRef.value);
|
tabHeight = getVisibleHeight(wrapRef.value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user