🐛(component): [tab] 修复 tab 更新

ISSUES CLOSED: #I5P4I3
This commit is contained in:
sight 2022-09-01 14:57:24 +08:00
parent fa37943b18
commit 919b1406e3

View File

@ -43,7 +43,6 @@ export interface LayTabProps {
}
const slot = useSlots();
const slots = slot.default && slot.default();
const childrens: Ref<VNode[]> = ref([]);
const slotsChange = ref(true);
const tabMap = reactive(new Map<number, TabData>());
@ -283,7 +282,7 @@ const renderTabChild = (child: TabData) => {
useResizeObserver(navRef, update);
watch(
slotsChange,
tabMap,
function () {
childrens.value = [];
setItemInstanceBySlot((slot.default && slot.default()) as VNode[]);