js用户自定义配置替换默认配置方法
const customConfig = { a: 22, b: 33 }
function config(config = {}) {
const defaultConfig = { a: 12, b: 23, c: 'aa' }
const finallyConfig = { ...defaultConfig, ...customConfig }
console.log(finallyConfig)//{ a: 22, b: 33, c: 'aa' }
}
config(customConfig)

浙公网安备 33010602011771号