[bugfix] Tab: title slot render (#1212)
This commit is contained in:
@@ -19,8 +19,7 @@
|
||||
}"
|
||||
@click="onClick(index)"
|
||||
>
|
||||
<van-node v-if="tab.$slots.title" :node="tab.$slots.title" />
|
||||
<span class="van-ellipsis" v-else>{{ tab.title }}</span>
|
||||
<span class="van-ellipsis" ref="title">{{ tab.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,7 +33,6 @@
|
||||
import create from '../utils/create';
|
||||
import { raf } from '../utils/raf';
|
||||
import { on, off } from '../utils/event';
|
||||
import VanNode from '../utils/node';
|
||||
import scrollUtils from '../utils/scroll';
|
||||
import Touch from '../mixins/touch';
|
||||
|
||||
@@ -43,10 +41,6 @@ export default create({
|
||||
|
||||
mixins: [Touch],
|
||||
|
||||
components: {
|
||||
VanNode
|
||||
},
|
||||
|
||||
model: {
|
||||
prop: 'active'
|
||||
},
|
||||
@@ -261,6 +255,14 @@ export default create({
|
||||
}
|
||||
};
|
||||
animate();
|
||||
},
|
||||
|
||||
// render title slot of child tab
|
||||
renderTitle(el, index) {
|
||||
this.$nextTick(() => {
|
||||
const title = this.$refs.title[index];
|
||||
title.parentNode.replaceChild(el, title);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user