Skip to content
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

[K4] Accessing Kirby components #19

Closed
rasteiner opened this issue May 26, 2023 · 3 comments
Closed

[K4] Accessing Kirby components #19

rasteiner opened this issue May 26, 2023 · 3 comments

Comments

@rasteiner
Copy link
Owner

The use plugins seem to be run before the Kirby components have been registered.

This plugin relied on the following pattern:

In a use extension:

const options = Vue.component(type).options;
Vue.component(type, {
  extends: options,
  // my stuff
});

In Kirby 4, however, Vue.component(type) always seems to return undefined.

Workaround

Defer the execution to the next javascript tick, at that point the components are accessible.

setTimeout(() => {
  const options = Vue.component(type).options;
  Vue.component(type, {
    extends: options,
    // my stuff
  });
}, 0);
@rasteiner
Copy link
Owner Author

probably duplicate of getkirby/kirby#5183

@distantnative
Copy link

Yes, would expect this to be solved with getkirby/kirby#5202 as well

@rasteiner
Copy link
Owner Author

fixed in alpha 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants