rasteiner / k3-whenquery

Conditionally show fields and sections. Better.
MIT License
64 stars 1 forks source link

[K4] Accessing Kirby components #19

Closed rasteiner closed 1 year ago

rasteiner commented 1 year ago

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 commented 1 year ago

probably duplicate of https://github.com/getkirby/kirby/issues/5183

distantnative commented 1 year ago

Yes, would expect this to be solved with https://github.com/getkirby/kirby/pull/5202 as well

rasteiner commented 1 year ago

fixed in alpha 2