chore: remove object spead (#8514)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PropType, defineComponent } from 'vue';
|
||||
import { createNamespace, UnknownProp } from '../utils';
|
||||
import { createNamespace, extend, UnknownProp } from '../utils';
|
||||
import { Popup } from '../popup';
|
||||
import { popupSharedProps } from '../popup/shared';
|
||||
|
||||
@@ -10,8 +10,7 @@ export type NotifyType = 'primary' | 'success' | 'danger' | 'warning';
|
||||
export default defineComponent({
|
||||
name,
|
||||
|
||||
props: {
|
||||
...popupSharedProps,
|
||||
props: extend({}, popupSharedProps, {
|
||||
color: String,
|
||||
message: [Number, String],
|
||||
className: UnknownProp,
|
||||
@@ -21,7 +20,7 @@ export default defineComponent({
|
||||
type: String as PropType<NotifyType>,
|
||||
default: 'danger',
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
setup(props, { slots }) {
|
||||
return () => {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { App } from 'vue';
|
||||
import { isObject, inBrowser, ComponentInstance, withInstall } from '../utils';
|
||||
import {
|
||||
extend,
|
||||
isObject,
|
||||
inBrowser,
|
||||
withInstall,
|
||||
ComponentInstance,
|
||||
} from '../utils';
|
||||
import { mountComponent, usePopupState } from '../utils/mount-component';
|
||||
import VanNotify, { NotifyType } from './Notify';
|
||||
|
||||
@@ -29,14 +35,7 @@ function initInstance() {
|
||||
({ instance } = mountComponent({
|
||||
setup() {
|
||||
const { state, toggle } = usePopupState();
|
||||
return () => (
|
||||
<VanNotify
|
||||
{...{
|
||||
...state,
|
||||
'onUpdate:show': toggle,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
return () => <VanNotify {...state} {...{ 'onUpdate:show': toggle }} />;
|
||||
},
|
||||
}));
|
||||
}
|
||||
@@ -50,10 +49,7 @@ function Notify(options: NotifyMessage | NotifyOptions) {
|
||||
initInstance();
|
||||
}
|
||||
|
||||
options = {
|
||||
...Notify.currentOptions,
|
||||
...parseOptions(options),
|
||||
};
|
||||
options = extend(Notify.currentOptions, parseOptions(options));
|
||||
|
||||
instance.open(options);
|
||||
clearTimeout(timer);
|
||||
|
||||
Reference in New Issue
Block a user