vue-backbone icon indicating copy to clipboard operation
vue-backbone copied to clipboard

bb function is overwritten completely if included both in mixin and in component

Open Sporradik opened this issue 4 years ago • 2 comments

Creating global mixin

Vue.mixin({
	bb() {
		return {
			conditionalFeatures: m.conditionalFeatures
		}
	}
})

Component

export default {
	bb() {
		return {
			customization: m.models.customization,
		}
	}
}

In the component, conditionalFeatures is undefined, but customization is present. If you remove bb from the component, then conditionalFeatures becomes available. If this were to follow vue's standard patterns, the objects would be merged and both properties would be present.

Sporradik avatar Jan 12 '21 23:01 Sporradik

thanks @Sporradik, you are right, this configuration isn't currently supported.

I don't know when I'll get time to look into it, but if you feel confident in providing a solution, I'm happy to look over a pull request.

mikeapr4 avatar Jan 16 '21 20:01 mikeapr4

Thanks @mikeapr4. Currently we have a workaround, because we can just avoid accessing the object through this and instead access it through the traditional means. So like you i'm not sure if I will be able to prioritize a fix soon, but if I can, I will submit a PR. Thanks for the sweet library!

Sporradik avatar Jan 20 '21 01:01 Sporradik