mirror of
https://github.com/youzan/vant.git
synced 2026-05-07 01:01:01 +08:00
refactor: reorganize all components (#8303)
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { PropType } from 'vue';
|
||||
import { PropType, defineComponent } from 'vue';
|
||||
import { createNamespace, UnknownProp } from '../utils';
|
||||
import Popup from '../popup';
|
||||
import { popupSharedProps } from '../popup/shared';
|
||||
|
||||
const [createComponent, bem] = createNamespace('notify');
|
||||
const [name, bem] = createNamespace('notify');
|
||||
|
||||
export type NotifyType = 'primary' | 'success' | 'danger' | 'warning';
|
||||
|
||||
export default createComponent({
|
||||
export default defineComponent({
|
||||
name,
|
||||
|
||||
props: {
|
||||
...popupSharedProps,
|
||||
color: String,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { App, Plugin } from 'vue';
|
||||
import { isObject, inBrowser, ComponentInstance } from '../utils';
|
||||
import { App } from 'vue';
|
||||
import { isObject, inBrowser, ComponentInstance, installable } from '../utils';
|
||||
import { mountComponent, usePopupState } from '../utils/mount-component';
|
||||
import VanNotify, { NotifyType } from './Notify';
|
||||
|
||||
@@ -97,10 +97,10 @@ Notify.resetDefaultOptions = () => {
|
||||
};
|
||||
|
||||
Notify.install = (app: App) => {
|
||||
app.use((VanNotify as unknown) as Plugin);
|
||||
app.use(installable(VanNotify));
|
||||
app.config.globalProperties.$notify = Notify;
|
||||
};
|
||||
|
||||
Notify.Component = VanNotify;
|
||||
Notify.Component = installable(VanNotify);
|
||||
|
||||
export default Notify;
|
||||
|
||||
Reference in New Issue
Block a user