types: using unknown instead of any (#8152)
* types: using unknown instead of any * chore: UnknownProp
This commit is contained in:
@@ -2,7 +2,7 @@ import { PropType, reactive } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { callInterceptor, Interceptor } from '../utils/interceptor';
|
||||
import { createNamespace, addUnit, pick } from '../utils';
|
||||
import { createNamespace, addUnit, pick, UnknownProp } from '../utils';
|
||||
import { BORDER_TOP, BORDER_LEFT } from '../utils/constant';
|
||||
|
||||
// Components
|
||||
@@ -32,7 +32,7 @@ export default createComponent({
|
||||
message: String,
|
||||
callback: Function as PropType<(action?: DialogAction) => void>,
|
||||
allowHtml: Boolean,
|
||||
className: null,
|
||||
className: UnknownProp,
|
||||
beforeClose: Function as PropType<Interceptor>,
|
||||
messageAlign: String as PropType<DialogMessageAlign>,
|
||||
showCancelButton: Boolean,
|
||||
|
||||
+11
-6
@@ -1,4 +1,9 @@
|
||||
import { App, TeleportProps } from 'vue';
|
||||
import {
|
||||
App,
|
||||
CSSProperties,
|
||||
TeleportProps,
|
||||
ComponentPublicInstance,
|
||||
} from 'vue';
|
||||
import { inBrowser } from '../utils';
|
||||
import { Interceptor } from '../utils/interceptor';
|
||||
import { mountComponent, usePopupState } from '../utils/mount-component';
|
||||
@@ -15,14 +20,14 @@ export type DialogOptions = {
|
||||
message?: string;
|
||||
overlay?: boolean;
|
||||
teleport?: TeleportProps['to'];
|
||||
className?: any;
|
||||
className?: unknown;
|
||||
allowHtml?: boolean;
|
||||
lockScroll?: boolean;
|
||||
transition?: string;
|
||||
beforeClose?: Interceptor;
|
||||
messageAlign?: DialogMessageAlign;
|
||||
overlayClass?: string;
|
||||
overlayStyle?: Record<string, any>;
|
||||
overlayStyle?: CSSProperties;
|
||||
closeOnPopstate?: boolean;
|
||||
cancelButtonText?: string;
|
||||
showCancelButton?: boolean;
|
||||
@@ -33,8 +38,8 @@ export type DialogOptions = {
|
||||
closeOnClickOverlay?: boolean;
|
||||
};
|
||||
|
||||
// TODO remove any
|
||||
let instance: any;
|
||||
// eslint-disable-next-line
|
||||
let instance: ComponentPublicInstance<{}, any>;
|
||||
|
||||
function initInstance() {
|
||||
const Wrapper = {
|
||||
@@ -82,7 +87,7 @@ Dialog.defaultOptions = {
|
||||
transition: 'van-dialog-bounce',
|
||||
beforeClose: null,
|
||||
overlayClass: '',
|
||||
overlayStyle: null,
|
||||
overlayStyle: undefined,
|
||||
messageAlign: '',
|
||||
cancelButtonText: '',
|
||||
cancelButtonColor: null,
|
||||
|
||||
Reference in New Issue
Block a user