diff --git a/components/affix/index.tsx b/components/affix/index.tsx index 64a225264..2a6b84741 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -127,23 +127,23 @@ const Affix = defineComponent({ newState.affixStyle = { position: 'fixed', top: fixedTop, - width: placeholderReact.width + 'px', - height: placeholderReact.height + 'px', + width: placeholderRect.width + 'px', + height: placeholderRect.height + 'px', }; newState.placeholderStyle = { - width: placeholderReact.width + 'px', - height: placeholderReact.height + 'px', + width: placeholderRect.width + 'px', + height: placeholderRect.height + 'px', }; } else if (fixedBottom !== undefined) { newState.affixStyle = { position: 'fixed', bottom: fixedBottom, - width: placeholderReact.width + 'px', - height: placeholderReact.height + 'px', + width: placeholderRect.width + 'px', + height: placeholderRect.height + 'px', }; newState.placeholderStyle = { - width: placeholderReact.width + 'px', - height: placeholderReact.height + 'px', + width: placeholderRect.width + 'px', + height: placeholderRect.height + 'px', }; } @@ -179,9 +179,9 @@ const Affix = defineComponent({ const targetNode = target(); if (targetNode && placeholderNode.value) { const targetRect = getTargetRect(targetNode); - const placeholderReact = getTargetRect(placeholderNode.value as HTMLElement); - const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop.value); - const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom.value); + const placeholderRect = getTargetRect(placeholderNode.value as HTMLElement); + const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop.value); + const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom.value); if ( (fixedTop !== undefined && affixStyle.top === fixedTop) || (fixedBottom !== undefined && affixStyle.bottom === fixedBottom) diff --git a/components/affix/utils.ts b/components/affix/utils.ts index 66d36aa1b..62ce50f27 100644 --- a/components/affix/utils.ts +++ b/components/affix/utils.ts @@ -9,19 +9,19 @@ export function getTargetRect(target: BindElement): DOMRect { : ({ top: 0, bottom: window.innerHeight } as DOMRect); } -export function getFixedTop(placeholderReact: DOMRect, targetRect: DOMRect, offsetTop: number) { - if (offsetTop !== undefined && targetRect.top > placeholderReact.top - offsetTop) { +export function getFixedTop(placeholderRect: DOMRect, targetRect: DOMRect, offsetTop: number) { + if (offsetTop !== undefined && targetRect.top > placeholderRect.top - offsetTop) { return `${offsetTop + targetRect.top}px`; } return undefined; } export function getFixedBottom( - placeholderReact: DOMRect, + placeholderRect: DOMRect, targetRect: DOMRect, offsetBottom: number, ) { - if (offsetBottom !== undefined && targetRect.bottom < placeholderReact.bottom + offsetBottom) { + if (offsetBottom !== undefined && targetRect.bottom < placeholderRect.bottom + offsetBottom) { const targetBottomOffset = window.innerHeight - targetRect.bottom; return `${offsetBottom + targetBottomOffset}px`; } diff --git a/components/button/index.en-US.md b/components/button/index.en-US.md index 471cf6bed..0de3dc711 100644 --- a/components/button/index.en-US.md +++ b/components/button/index.en-US.md @@ -40,7 +40,7 @@ Different button styles can be generated by setting Button properties. The recom | htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | | | icon | set the icon of button, see: Icon component | v-slot | - | | | loading | set the loading status of button | boolean \| { delay: number } | `false` | | -| shape | Can be set button shape | `default` \| `circle` \| `round` | 'default' | | +| shape | Can be set button shape | `default` \| `circle` \| `round` | `default` | | | size | set the size of button | `large` \| `middle` \| `small` | `middle` | | | target | same as target attribute of a, works when href is specified | string | - | | | type | can be set button type | `primary` \| `ghost` \| `dashed` \| `link` \| `text` \| `default` | `default` | | diff --git a/components/button/index.zh-CN.md b/components/button/index.zh-CN.md index 6f7827b68..91425ae5d 100644 --- a/components/button/index.zh-CN.md +++ b/components/button/index.zh-CN.md @@ -43,7 +43,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/fNUKzY1sk/Button.svg | htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | | | icon | 设置按钮的图标类型 | v-slot | - | | | loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` | | -| shape | 设置按钮形状 | `default` \| `circle` \| `round` | 'default' | | +| shape | 设置按钮形状 | `default` \| `circle` \| `round` | `default` | | | size | 设置按钮大小 | `large` \| `middle` \| `small` | `middle` | | | target | 相当于 a 链接的 target 属性,href 存在时生效 | string | - | | | type | 设置按钮类型 | `primary` \| `ghost` \| `dashed` \| `link` \| `text` \| `default` | `default` | | diff --git a/components/input/demo/textarea.vue b/components/input/demo/textarea.vue index 391c0ef00..cdb315864 100644 --- a/components/input/demo/textarea.vue +++ b/components/input/demo/textarea.vue @@ -19,7 +19,7 @@ For multi-line input.

- +