-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Kebap-case is not supported in some components like DataTable #1263
Comments
This issue was created several times in the past and is due to a missuse of vue but they still claim it's a vue bug. I had a conversation with the vue team and they also confirmed that vue should not be used the way it is used here... For more info #797 (comment) |
This problem will pop up for many users new to PrimeVue: If you use Vetur and the eslint plugin "vue/vue3-recommended", "selectionMode" will be converted by eslint autofix to "selection-mode" and the checkboxes are missing. Many a new user will then leave PrimeVue. So the team should really consider to fix this. |
I know, I'll do the same once I finish my current project with it because of those reasons. Unfortunately there is nothing we can do except writing many pull requests for every single component. But I guess not so many will leave - the mayority will just disable their linter. |
I believe vue only does the transformation when used with in-dom templates not string templates; https://v3.vuejs.org/guide/component-props.html#prop-casing-camelcase-vs-kebab-case kebab-case props are ignored for sure and does not function however not sure if there is anything we can do on our side. By the way reason of camel-case is used on components as a convention as PrimeFaces, PrimeReact and PrimeNG also do it. Also I do not think Vue enforces a convention, docs state there are two options; https://vuejs.org/v2/guide/components-registration.html For events, they suggest kebab so we used that for all the events; https://vuejs.org/v2/guide/components-custom-events.html#Event-Names If Vue can transform them somehow in string templates or allow an alias option, that'd be great. You know we can't change prop names casing as it'll break all the apps. Open to suggestions. |
@cagataycivici Thank you very much for your attention. You (PrimeVue) use raw html attributes to check the props. Vue does not yet proceed them at this point. The current behavior is
Vue creates a Component with a
(with placeholders I mean things like these https://github.com/primefaces/primevue/blob/master/src/components/column/Column.vue) Edit: an easy way to see what I mean (for Vue 2 - this is unfortunately removed in Vue 3) is the following, select a component via Dev Tools and just print
|
Just a s a side note: fixing this issue by removing I really hope someone has an eye on this. |
@dheimoz any progress per #797 (comment)? For now I added an exception in my lint config:
|
hello @Jogai hope you are doing great. I am a Primve Vue user, just like you. The PrimeTek team will work on the priorities they define. |
Oh, you're not a team member? In the other thread it sounded like you were. Anyway, found another one to ignore: "headerClass" on the column in the datatable |
@Jogai great! thanks for sharing |
Found another: "rowEditor" |
I spent a long time trying to figure out if I had done something wrong after I couldn't get the checkboxes to appear because of this issue. At the very least it would be nice to have a warning in the docs, because it violates user expectations. Thank you @Jogai for posting the eslint config workaround. |
Hello there,
Regards, |
Hello guys, i am using primevue version 3 and i need use the double click event from DataTable, but is not working. Can anybody help me? Sorry for my english, i'm using google translate. |
@matheuspaulo93 use row-dblclick. But that is not the discussion here. |
We'll work on this again this week for potential improvements. |
Thanks, it works. |
@Anubarak, I see the issue now, the reason why I had to access vnodes was during migration from Vue 2 to Vue 3 where I could not find a way to access components. #1 would work but it is not ideal to check for kebap-case ourselves. Trying to figure out a way to access child components, hopefully newer versions of Vue 3.x had some ways to do it. |
This is hopefully resolved now, components with issues were DataTable and TreeTable mainly who need to access their children. Since Vue 3 remove $children with no replacement, we had to use vnodes that caused this as we use camel by default. Just like Vue does, we now do kebab-camel conversion for these components and the issue is resolved. If one day $children is back, we'll migrate to that for sure. Thanks for everyone contributed to this issue. 4th of October is the release for 3.7.3 |
It seems this issue is present for |
Edit: after updating Nuxt to 3.10.0 it resolved my problem. |
I'm submitting a ... (check one with "x")
CodeSandbox Case (Bug Reports)
Take the Checkbox example from https://primefaces.org/primevue/showcase/#/datatable/selection and replace "selectionMode" by "selection-mode".
Current behavior
The checkboxes are missing
Expected behavior
The checkboxes should be visible.
Vue version: 3.0.5
yes
PrimeVue version: 3.4.0
yes
The text was updated successfully, but these errors were encountered: