Vue3 Composition API: Adding Inertia pages to an Inertia-based app via a package #1515
Unanswered
craigrileyuk
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm struggling with this one and wondered if anyone has any ideas.
Say you have 2 x Laravel packages. One is a base package, and then the other is an addon package.
The base package has to be precompiled as does the the addon package.
The addon package should contain Vue pages that can be consumed by the base package.
During Vue2/Options API time, https://github.com/ycs77/inertia-plugin with its runtime registration worked perfectly.
However it's causing problems when I'm trying to use the Composition API since the base package and the addons package are importing from separate instances of Vue and @inertiajs/vue (whereas in the Options API they had access to
this
) meaning that usePage, getCurrentInstance, Inject et al are all null in the addon package.Is it possible to get the addons package to work with the Composition API inside the base package? All the solutions I can think of involve having to import the addon package directly into the base package, which isn't possible.
Beta Was this translation helpful? Give feedback.
All reactions