inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.35k stars 427 forks source link

$page.url breaking change #2020

Open Cacamoto opened 22 hours ago

Cacamoto commented 22 hours ago

Version:

Describe the problem:

$page.url returns http://localhost:8000/ instead of /

Steps to reproduce:

Update to v2 and {{ $page.url }}

pedroborges commented 21 hours ago

@Cacamoto what backend adapter are you using? With the Laravel adapter I'm still getting the full path as usual, see below. The URL value comes from the backend.

Screen Shot 2024-10-11 at 12 43 58
chhaihongsrun commented 5 hours ago

Version:

  • @inertiajs/vue3 version: lagest

Describe the problem:

$page.url returns http://localhost:8000/ instead of /

Steps to reproduce:

Update to v2 and {{ $page.url }}

yes, you are right. when I want to activate the link, I use url.startsWith('profile') it no longer works. I switch to use component === 'Profile/Edit' ? 'active' : 'nope'

ref: https://laracasts.com/series/build-modern-laravel-apps-using-inertia-js/episodes/8

Cacamoto commented 5 hours ago

@pedroborges "inertiajs/inertia-laravel": "2.x-dev" $page.component === 'Home' ? 'outline' : 'ghost' works as expected