chore(@vant/use): fix some lint issues (#8462)

This commit is contained in:
neverland
2021-04-06 20:03:26 +08:00
committed by GitHub
parent fe453dabb1
commit ace4c9b60b
8 changed files with 33 additions and 36 deletions
+3 -1
View File
@@ -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;
```
### 返回值
+2 -2
View File
@@ -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;