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

Support for hyphenated props #196

Open
chojnicki opened this issue Jul 11, 2022 · 2 comments
Open

Support for hyphenated props #196

chojnicki opened this issue Jul 11, 2022 · 2 comments

Comments

@chojnicki
Copy link

In Vue it's common practice to use hyphenated props instead camelCased.
It's also listed in eslint vue rules. https://eslint.vuejs.org/rules/attribute-hyphenation.html

But this will not work with vue-konva. If I'm using :stroke-width="1" it's ignored. I'm forced to use :strokeWidth="1" instead, which is not how I'm using props in whole project and which gives me eslint errors:

Attribute ':strokeWidth' must be hyphenated.eslint[vue/attribute-hyphenation](https://eslint.vuejs.org/rules/attribute-hyphenation.html)

My only option is to ignore eslint or pass all options as single param.

I did not looked into source, but my guess is that this library just copies all passed attributes to object and then passes to standard Konva, without defining real props in component. But I think simple conversion from hypenated props to camelCased could be possible ;)

@lavrton
Copy link
Member

lavrton commented Jul 12, 2022

Well, as I remember, vue-konva doesn't support :strokeWidth="1" at all. You have to pass all options via config attribute.

But it will be nice to support separate props and hyphenated variants. I can't resolve that now, but I am happy to review/merge any related Pull Requests.

@chojnicki
Copy link
Author

Well, as I remember, vue-konva doesn't support :strokeWidth="1" at all.

It does :)

Thanks for reply. I could make pull request at some point, but for now I moved to implementation with plain Konva in Vue, since it's more flexible, and I'm happy with that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants