Answer the question
In order to leave comments, you need to log in
Passing a parameter to a mixin?
Because wu has the best support for TS, it is not yet clear to me how to pass the parameter at the compilation stage.
If you pass a parameter after the mixin is initialized, then there will be errors. The mixin needs a parameter to work. $emit and store won't help here.
Answer the question
In order to leave comments, you need to log in
There is no adequate solution, passing dynamic parameters to Vue 2 + TS is conditionally impossible.
@Template
@Component<AccountSettingsForm>(
{
components: {},
mixins: [
testMixin(this.namespace)
],
export default class AccountSettingsForm extends mixins(Mixin_1(this.param)) {...}
You're clearly misusing mixins. Think of mixins as multiple inheritance. You cannot dynamically change the class from which it is inherited depending on the parameters of the instance, no?
So here you have to come up with something different. Most likely you just need to reverse the approach - make a mixin what you have is a component, and components (different) - what you want to make a mixin.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question