We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge函数中有一个bug。 options = { ...mixin, ...options } 应当修改为 options[key] = value 详情如下:
function merge (mixins, options) { mixins.forEach((mixin) => { if (Object.prototype.toString.call(mixin) !== '[object Object]') { throw new Error('mixin 类型必须为对象!') } for (let [key, value] of Object.entries(mixin)) { if (originProperties.includes(key)) { options[key] = { ...value, ...options[key] } } else if (originMethods.includes(key)) { const originFunc = options[key]; options[key] = function (...args) { value.call(this, ...args); return originFunc && originFunc.call(this, ...args) } } else { // options = { ...mixin, ...options } options[key] = value } } }) return options
The text was updated successfully, but these errors were encountered:
No branches or pull requests
merge函数中有一个bug。
options = { ...mixin, ...options } 应当修改为 options[key] = value
详情如下:
function merge (mixins, options) {
mixins.forEach((mixin) => {
if (Object.prototype.toString.call(mixin) !== '[object Object]') {
throw new Error('mixin 类型必须为对象!')
}
for (let [key, value] of Object.entries(mixin)) {
if (originProperties.includes(key)) {
options[key] = { ...value, ...options[key] }
} else if (originMethods.includes(key)) {
const originFunc = options[key];
options[key] = function (...args) {
value.call(this, ...args);
return originFunc && originFunc.call(this, ...args)
}
} else {
// options = { ...mixin, ...options }
options[key] = value
}
}
})
return options
The text was updated successfully, but these errors were encountered: