refactor: reorganize all components (#8303)

This commit is contained in:
neverland
2021-03-08 11:50:37 +08:00
committed by GitHub
parent 3144a63d2b
commit e540876398
193 changed files with 1307 additions and 400 deletions
+5 -3
View File
@@ -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,
+4 -4
View File
@@ -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;