-
Notifications
You must be signed in to change notification settings - Fork 113
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
#298 Adjust type of prop 'link' of FwbSidebarItem.vue #299
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe Changes
Poem
Tip AI model upgrade
|
✅ Deploy Preview for sensational-seahorse-8635f8 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
src/components/FwbSidebar/FwbSidebarItem.vue (1)
22-22
: Ensure type safety for thelink
prop.The type
{ name: string }
for thelink
prop is flexible and beneficial. However, consider extracting this into an interface for better readability and maintainability.interface LinkObject { name: string } const props = withDefaults( defineProps<{ link?: string | LinkObject tag?: string }>(), { link: '/', tag: 'router-link', }, )
Now, what I made here is a very rudimentary solution. First I'd like some feedback if you would be open for such an enhancement. Then I make a more cleaner solution. |
#298
In order to make the
<FwbSidebarItem>
work with named router links, I propose the following.Now of course, the type
{ name: string }
could be extracted into aninterface
if you wish.Edit:
This could be adjusted to take route parameters in the
FwbSidebarItem
, so the input would not be just{ name: string }
instead{ name: string, params ?: {[key: string]: string|number} }
Of course the type for the
params
is more complex than this:{[key: string]: string|number}
.Summary by CodeRabbit