-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
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
v8 mixins - created() not called - what am I doing wrong? #514
Comments
You have to use the Also, you don't need to use the |
@Kapcash I'm talking about vue-class-component 8.0.0-rc.1 for Vue 3, not the old one for Vue 2. The |
I am not quite sure if this's a bug or it's deigned so. The callSyncHook(
'created',
LifecycleHooks.CREATED,
options,
instance,
globalMixins
) function callSyncHook(
name: 'beforeCreate' | 'created',
type: LifecycleHooks,
options: ComponentOptions,
instance: ComponentInternalInstance,
globalMixins: ComponentOptions[]
) {
callHookFromMixins(name, type, globalMixins, instance)
const { extends: base, mixins } = options
if (base) {
callHookFromExtends(name, type, base, instance)
}
if (mixins) {
callHookFromMixins(name, type, mixins, instance)
}
const selfHook = options[name]
if (selfHook) {
callWithAsyncErrorHandling(selfHook.bind(instance.proxy!), instance, type)
}
} According to the code logic, the
|
I usually have several mixins into a single component so the above workaround wouldn't work for me as you can only inherit one class. |
Tracking here vuejs/core#3038 |
I'm using 8.0.0-rc.1.
I have this simple .vue file component. When AppTest is rendered in the DOM, I'm not seeing "hello from mixin!" in the console. Is there something off with this syntax below?
The text was updated successfully, but these errors were encountered: