From 1dc1b708f0c3d32c5b4082926e072439f68540b7 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 3 Mar 2021 17:46:00 +0800 Subject: [PATCH] types: reduce any (#8256) --- src/dialog/index.tsx | 4 ++-- src/image-preview/index.tsx | 4 ++-- src/notify/index.tsx | 4 ++-- src/toast/index.tsx | 4 ++-- src/uploader/index.tsx | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dialog/index.tsx b/src/dialog/index.tsx index 1108be6cf..c1df01a5a 100644 --- a/src/dialog/index.tsx +++ b/src/dialog/index.tsx @@ -1,4 +1,4 @@ -import { App, CSSProperties, TeleportProps } from 'vue'; +import { App, Plugin, CSSProperties, TeleportProps } from 'vue'; import { inBrowser, ComponentInstance } from '../utils'; import { Interceptor } from '../utils/interceptor'; import { mountComponent, usePopupState } from '../utils/mount-component'; @@ -120,7 +120,7 @@ Dialog.resetDefaultOptions = () => { }; Dialog.install = (app: App) => { - app.use(VanDialog as any); + app.use((VanDialog as unknown) as Plugin); app.config.globalProperties.$dialog = Dialog; }; diff --git a/src/image-preview/index.tsx b/src/image-preview/index.tsx index 01d286b45..119ad68d1 100644 --- a/src/image-preview/index.tsx +++ b/src/image-preview/index.tsx @@ -1,4 +1,4 @@ -import { App, TeleportProps } from 'vue'; +import { App, Plugin, TeleportProps } from 'vue'; import { ComponentInstance, inBrowser } from '../utils'; import { mountComponent, usePopupState } from '../utils/mount-component'; import { Interceptor } from '../utils/interceptor'; @@ -96,7 +96,7 @@ const ImagePreview = ( ImagePreview.Component = VanImagePreview; ImagePreview.install = (app: App) => { - app.use(VanImagePreview as any); + app.use((VanImagePreview as unknown) as Plugin); }; export default ImagePreview; diff --git a/src/notify/index.tsx b/src/notify/index.tsx index dda85d55f..c9c964589 100644 --- a/src/notify/index.tsx +++ b/src/notify/index.tsx @@ -1,4 +1,4 @@ -import { App } from 'vue'; +import { App, Plugin } from 'vue'; import { isObject, inBrowser, ComponentInstance } from '../utils'; import { mountComponent, usePopupState } from '../utils/mount-component'; import VanNotify, { NotifyType } from './Notify'; @@ -97,7 +97,7 @@ Notify.resetDefaultOptions = () => { }; Notify.install = (app: App) => { - app.use(VanNotify as any); + app.use((VanNotify as unknown) as Plugin); app.config.globalProperties.$notify = Notify; }; diff --git a/src/toast/index.tsx b/src/toast/index.tsx index 31b017f78..79e81baa8 100644 --- a/src/toast/index.tsx +++ b/src/toast/index.tsx @@ -1,4 +1,4 @@ -import { ref, App, TeleportProps, getCurrentInstance } from 'vue'; +import { ref, App, Plugin, TeleportProps, getCurrentInstance } from 'vue'; import { isObject, inBrowser, ComponentInstance } from '../utils'; import { mountComponent, usePopupState } from '../utils/mount-component'; import VanToast, { ToastType, ToastPosition } from './Toast'; @@ -179,7 +179,7 @@ Toast.allowMultiple = (value = true) => { }; Toast.install = (app: App) => { - app.use(VanToast as any); + app.use((VanToast as unknown) as Plugin); app.config.globalProperties.$toast = Toast; }; diff --git a/src/uploader/index.tsx b/src/uploader/index.tsx index e650393ce..36e5fe769 100644 --- a/src/uploader/index.tsx +++ b/src/uploader/index.tsx @@ -309,7 +309,7 @@ export default createComponent({ type="file" class={bem('input')} accept={props.accept} - capture={props.capture as any} + capture={(props.capture as unknown) as boolean} multiple={props.multiple} disabled={props.disabled} onChange={onChange}