받는 소품에 따라 mixin이 필요한 구성 요소가 있습니다.mixin을 구성 요소에 동적으로 주입하는 방법
const timerMixin = {
created() {
console.log("Timer mixin injected")
}
}
export default {
name: 'Component A',
props: ['hasTimer'],
mixins: this.hasTimer ? [timerMixin] : [] // fails because `this` is not available here
}
믹스 인을 구성 요소에 동적으로 주입 할 수있는 방법이 있습니까?