diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index 484760569..60f9e243d 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -160,8 +160,6 @@ export default defineComponent({ const { offsetTop, targetOffset } = props; setCurrentActiveLink(link); - const container = getContainer.value(); - const scrollTop = getScroll(container, true); const sharpLinkMatch = sharpMatcherRegx.exec(link); if (!sharpLinkMatch) { return; @@ -171,6 +169,8 @@ export default defineComponent({ return; } + const container = getContainer.value(); + const scrollTop = getScroll(container, true); const eleOffsetTop = getOffsetTop(targetElement, container); let y = scrollTop + eleOffsetTop; y -= targetOffset !== undefined ? targetOffset : offsetTop || 0; diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index d68a4a147..c2cd97ef9 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -100,6 +100,7 @@ const InputNumber = defineComponent({ }; return () => { const { hasFeedback, isFormItemInput, feedbackIcon } = formItemInputContext; + const id = props.id ?? formItemContext.id.value; const { class: className, bordered, @@ -110,7 +111,7 @@ const InputNumber = defineComponent({ prefix = slots.prefix?.(), valueModifiers = {}, ...others - } = { ...attrs, ...props } as InputNumberProps & HTMLAttributes; + } = { ...attrs, ...props, id } as InputNumberProps & HTMLAttributes; const preCls = prefixCls.value; diff --git a/components/menu/demo/inline.vue b/components/menu/demo/inline.vue index 8f9908131..abd3f4eab 100644 --- a/components/menu/demo/inline.vue +++ b/components/menu/demo/inline.vue @@ -78,10 +78,7 @@ const handleClick: MenuProps['onClick'] = e => { console.log('click', e); }; -watch( - () => openKeys, - val => { - console.log('openKeys', val); - }, -); +watch(openKeys, val => { + console.log('openKeys', val); +}); diff --git a/components/table/hooks/useColumns.tsx b/components/table/hooks/useColumns.tsx index 8aed4d259..aab022e25 100644 --- a/components/table/hooks/useColumns.tsx +++ b/components/table/hooks/useColumns.tsx @@ -37,7 +37,7 @@ function fillSlots(columns: ColumnsType, contextSlots: R () => [column.title as any], ); } - if ('children' in cloneColumn) { + if ('children' in cloneColumn && Array.isArray(cloneColumn.children)) { cloneColumn.children = fillSlots(cloneColumn.children, contextSlots); }