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

Binding viewBox attribute on svg #2250

Closed
simplesmiler opened this issue Jan 28, 2016 · 5 comments
Closed

Binding viewBox attribute on svg #2250

simplesmiler opened this issue Jan 28, 2016 · 5 comments

Comments

@simplesmiler
Copy link
Member

Binding viewBox attribute on svg does not seen to work.

Repro: https://jsfiddle.net/ct1zagyz/2/

@simplesmiler simplesmiler changed the title Binding viewBox attribute on svg does not seen to work Binding viewBox attribute on svg Jan 28, 2016
@yyx990803
Copy link
Member

Hmm, this is annoying because HTML parsing only preserves the camelCase for valid camelCase attributes, so v-bind:viewBox is converted to v-bind:viewbox before the directive can handle it.

Two things I'm considering:

  1. Add a .camel modifier so that you can do <svg :view-box.camel="xxx">. A bit indirect but is trivial to implement.
  2. Include a built-in whitelist of valid SVG camelCase attributes. The annoying part is the list will either be super long (thus shipping a lot of extra code that is likely unused in a lot of scenarios), or be incomplete. I personally do not work with SVG a lot, but would like to get feedback on how common such camelCase attributes are encountered.

@Mat-Moo
Copy link

Mat-Moo commented Jan 28, 2016

Could svg attributes as a whole be ignored, would that be simpler?

@simplesmiler
Copy link
Member Author

I'll take the .camel over the whitelist.

@yyx990803
Copy link
Member

@simplesmiler ok, it's already in the dev branch :)

@Dhruuva
Copy link

Dhruuva commented Aug 1, 2016

thank you for post

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

4 participants