feat: add @vant/compat package (#10806)
* feat: add @vant/compat package * chore: remove prepare script
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
Notify as VanNotify,
|
||||
showNotify,
|
||||
closeNotify,
|
||||
setNotifyDefaultOptions,
|
||||
resetNotifyDefaultOptions,
|
||||
} from 'vant';
|
||||
import type { App } from 'vue';
|
||||
|
||||
export const Notify = (...args: Parameters<typeof showNotify>) =>
|
||||
showNotify(...args);
|
||||
|
||||
Notify.clear = closeNotify;
|
||||
Notify.Component = VanNotify;
|
||||
Notify.setDefaultOptions = setNotifyDefaultOptions;
|
||||
Notify.resetDefaultOptions = resetNotifyDefaultOptions;
|
||||
|
||||
Notify.install = (app: App) => {
|
||||
app.use(Notify.Component);
|
||||
app.config.globalProperties.$notify = Notify;
|
||||
};
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface ComponentCustomProperties {
|
||||
$notify: typeof Notify;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user