ycs77 / inertia-page-loader

The plugin page loader for Inertia.js
MIT License
25 stars 0 forks source link

Support for Vue3 Composition API #4

Closed craigrileyuk closed 2 weeks ago

craigrileyuk commented 1 year ago

At the moment, this plugin works perfectly for the Options API in Vue 2 and 3.

However, I'm having problems when it comes to using it with Vue 3's Composition API since rather than using this to access the host app's state, you import functions that return that state (e.g. usePage, getCurrentInstance and inject).

All of the above functions return null when using the Composition API since the imports in your addons don't resolve to the same place as the same imports your host app.

Environment: runtime registration Builder: Vite

ycs77 commented 2 weeks ago

Hi @craigrileyuk, thanks for your report, but after my test, the vue 3 composition API component is very dependent on the bundler, recommended using the Build for Static instead.