mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(edit) initConfig: default parameters
This commit is contained in:
parent
5fbbb114c8
commit
1aaf9e63ec
1 changed files with 3 additions and 6 deletions
|
|
@ -59,16 +59,13 @@ function EditProto(callback) {
|
|||
throw Error(name + ' should be a function!');
|
||||
}
|
||||
|
||||
function initConfig(config = {}, options) {
|
||||
Object.assign(config, ConfigView);
|
||||
|
||||
if (!options)
|
||||
return config;
|
||||
function initConfig(options = {}) {
|
||||
const config = Object.assign({}, options, ConfigView);
|
||||
|
||||
if (options.afterShow) {
|
||||
checkFn('options.afterShow', options.afterShow);
|
||||
|
||||
const afterShow = config.afterShow;
|
||||
const afterShow = {config};
|
||||
|
||||
config.afterShow = () => {
|
||||
afterShow();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue