You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the addition of the new as Inertia link option (#271), it has me rethinking the use of href for defining the URL for Inertia links. Previously this seemed fine, but now that Inertia links can be different element entirely, such as a div or a button, this no longer feels right.
Vue Router and React Router use the to attribute instead of href, which isn't bad:
However, speaking with @nunomaduro, he had another interesting idea. What if instead of using the href or to, we instead had method specific attributes. For example:
This discussion was converted from issue #272 on December 19, 2020 17:27.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
With the addition of the new
as
Inertia link option (#271), it has me rethinking the use ofhref
for defining the URL for Inertia links. Previously this seemed fine, but now that Inertia links can be different element entirely, such as adiv
or abutton
, this no longer feels right.Vue Router and React Router use the
to
attribute instead ofhref
, which isn't bad:However, speaking with @nunomaduro, he had another interesting idea. What if instead of using the
href
orto
, we instead had method specific attributes. For example:I really like how this reads. Not only does it solve the
href
issue, it also allows you to define the method and URL using one attribute. 👌And, of course, we would maintain support for the
href
andmethod
attributes for backwards compatibility.Beta Was this translation helpful? Give feedback.
All reactions