Cannot use Inertia to get route in custom tool when trying to override Index view #5600
Replies: 1 comment 3 replies
-
The feature available in Laravel Nova 3 is provided by vue-router and Inertia doesn't provide any equivalent feature hence the custom code. Also, all those components aren't in our Public API and support for usage mainly for it's internal usage. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Internia
in custom nova tool return object:Detailed steps to reproduce the issue on a fresh Nova installation:
I'm trying to override the
Index
view invendor/laravel/nova/resources/js/views/Index.vue
. Below is steps to reproduce:php artisan nova:tool giangnh/nova-customization
Index.vue
and copy all code from file:vendor/laravel/nova/resources/js/views/Index.vue
asset.js
webpack.mix.js
npm install
(in directorynova-components
) then build codenpm run dev
vendor/laravel/nova/resources/js/mixins/InteractsWithQueryString.js
in method:The error come from line
if (page.url !==
${window.location.pathname}?${searchParams}) {
becausepage
returnnull
and Inertia return an object like{visitId: null}
I also have another page called excel importer, in which I tried to log
Inertia
in the vue component. InExcelInporter.vue
{visitId: null}
asset.js
I'm not sure this is a bug or desired behavior, but is there any way to get the current url & set url in the component? I can do it by vue-router in laravel nova 3 but in version 4 it seems to be removed.
Beta Was this translation helpful? Give feedback.
All reactions