I am currently working on defining components based on the prefix when Vue parses the content (without using Vuex).
While exploring, I came across Vue.config's isUnknownElement
function but couldn't find any documentation about it. By utilizing this function, I can call Vue.component (with an async function) if the prefix matches, avoiding the unknown component error. However, the component doesn't render immediately because the async function is not triggered until the next time the tag is parsed.
Up to now, the only workaround I've discovered is to render the component twice (using a v-if and updating the bound variable).
Is there a more efficient way of achieving this?
Why am I doing this? In my single-page applications, I have a series of custom components all sharing a common prefix and path structure, resulting in the component name matching its path (replacing dashes with slashes). This is why having a universal function to dynamically register each component starting with this prefix would be extremely useful :)