chore: remove object spead (#8514)

This commit is contained in:
neverland
2021-04-12 20:57:24 +08:00
committed by GitHub
parent 0b764b6347
commit 9deca34d1d
41 changed files with 204 additions and 241 deletions
+9 -13
View File
@@ -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);