chore(@vant/use): fix some lint issues (#8462)
This commit is contained in:
@@ -31,7 +31,9 @@ export default {
|
||||
### 类型定义
|
||||
|
||||
```ts
|
||||
function useRect((Element | Window) | Ref<Element | Window | undefined>): DOMRect;
|
||||
function useRect(
|
||||
element: Element | Window | Ref<Element | Window | undefined>
|
||||
): DOMRect;
|
||||
```
|
||||
|
||||
### 返回值
|
||||
|
||||
@@ -16,9 +16,9 @@ function makeDOMRect(width: number, height: number) {
|
||||
}
|
||||
|
||||
export const useRect = (
|
||||
elementRef: (Element | Window) | Ref<Element | Window | undefined>
|
||||
elementOrRef: Element | Window | Ref<Element | Window | undefined>
|
||||
) => {
|
||||
const element = unref(elementRef);
|
||||
const element = unref(elementOrRef);
|
||||
|
||||
if (isWindow(element)) {
|
||||
const width = element.innerWidth;
|
||||
|
||||
Reference in New Issue
Block a user