-
Notifications
You must be signed in to change notification settings - Fork 481
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
feat(Toggle): customize onValue & offValue values #1152
feat(Toggle): customize onValue & offValue values #1152
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
Would you mind explaining a use-case for this? |
The use-case for this feature is to increase the reusability of the toggle component by enabling users to set selected and unselected values with ease. By incorporating functionality similar to Vuetify's switches, this approach provides a more flexible and customizable way to implement toggle functionality throughout the application. This streamlines development and ensures a consistent user experience across all parts of the application. |
It would be nice to add a section to the docs too π |
Could you also fix the lint error? |
type: AnyType, | ||
default: false | ||
}, | ||
selectedValue: { |
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.
Actually, it would be better to call it onValue
and offValue
like for the icons I guess.
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.
Yes, that's correct. A toggle component is commonly used to switch something on or off, such as a setting or feature within a user interface.
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.
Actually, it would be better to call it
onValue
andoffValue
like for the icons I guess.
I replaced the prop names 'onValue' and 'offValue' with 'selectedValue' and 'unselectedValue,' respectively. The initial change was made to enhance the clarity and consistency of the component's props. However, I realized that using props that start with 'on' causes Vue to automatically detect an emit, which is a problem for documentation purposes. Therefore, I decided to revert the change and use the original prop names to avoid any conflicts and ensure proper functionality.
β¦ onValue and offValue" This reverts commit 7859111.
To avoid any confusion or issues with the component's documentation, I decided to switch back to the original prop names. This way, everything is clear and accurate, making it easier for developers to understand how the component works and how to use it in their projects. |
@@ -1,5 +1,5 @@ | |||
{ | |||
"extends": "./.nuxt/tsconfig.json", | |||
"extends": "./docs/.nuxt/tsconfig.json", |
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.
Why change this?
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.
when i run project i have many issues about this
the path is not correct
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.
Did you run pnpm run dev:prepare
? https://ui.nuxt.com/getting-started/contributing#_2-local-development-setup
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.
no π
I remove this change
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.
Would you mind adding those new fields to the documentation?
I will |
I'm having trouble running the documentation. When I try to run it and add some text anywhere, the app crashes. I'm not sure what's causing this issue, and I was hoping you might have some insight or suggestions on how to fix it. |
Do you have an error?? What do you mean by crash? |
I can run the documentation, but when I try to modify it, I get an error in the console, and eventually the app crashes. The error message looks something like this: [nuxt] [request error] [fatal] [404] Page not found and warning message in the chrome console about hydration mismatch
|
π Linked issue
Resolves #1139
β Type of change
π Description
π Checklist