Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Treat empty string as a valid URL in VListItem #20770

Open
flyotlin opened this issue Dec 9, 2024 · 0 comments
Open

[Feature Request] Treat empty string as a valid URL in VListItem #20770

flyotlin opened this issue Dec 9, 2024 · 0 comments

Comments

@flyotlin
Copy link

flyotlin commented Dec 9, 2024

Problem to solve

Currently empty string '' is treated as invalid link.

When I use VListItem in the following way, if status is closed, <div> rather than <a> tag is rendered, because '' is treated as invalid link.

Moreover, when status changed, <div> won't be changed to <a> again, because it's not reactive.

I'm not sure this (treating empty string as invalid link) is by-design or a bug. If the maintainers think this is a bug, I can help code a solution

// status = 'opened' || 'closed'
<v-list-item
:to="status == 'closed' ? '' : `/item/${item.id}`"
>
...
</v-list-item>

Proposed solution

Modify how useRouter determine a link is valid or not.

Versions

  • vuetify: v3.7.5
  • vue: v3.3.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant