变更
This commit is contained in:
@@ -63,11 +63,14 @@ const _sfc_main = defineComponent({
|
||||
const removeItem = (id) => {
|
||||
tabMap.delete(id);
|
||||
};
|
||||
provide(TabInjectKey, reactive({
|
||||
active,
|
||||
addItem,
|
||||
removeItem
|
||||
}));
|
||||
provide(
|
||||
TabInjectKey,
|
||||
reactive({
|
||||
active,
|
||||
addItem,
|
||||
removeItem
|
||||
})
|
||||
);
|
||||
const change = function(id) {
|
||||
if (props.beforeLeave && props.beforeLeave(id) === false) {
|
||||
return;
|
||||
@@ -263,19 +266,26 @@ const _sfc_main = defineComponent({
|
||||
}
|
||||
};
|
||||
useResizeObserver(navRef, update);
|
||||
watch(tabMap, () => {
|
||||
childrens.value = [];
|
||||
setItemInstanceBySlot(slot.default && slot.default());
|
||||
}, { immediate: true });
|
||||
watch(() => [
|
||||
props.modelValue,
|
||||
props.tabPosition,
|
||||
props.type,
|
||||
childrens.value.length
|
||||
], async () => {
|
||||
await nextTick();
|
||||
update();
|
||||
});
|
||||
watch(
|
||||
tabMap,
|
||||
() => {
|
||||
childrens.value = [];
|
||||
setItemInstanceBySlot(slot.default && slot.default());
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
watch(
|
||||
() => [
|
||||
props.modelValue,
|
||||
props.tabPosition,
|
||||
props.type,
|
||||
childrens.value.length
|
||||
],
|
||||
async () => {
|
||||
await nextTick();
|
||||
update();
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
update();
|
||||
scrollToActiveTab();
|
||||
|
||||
Reference in New Issue
Block a user