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

feat: support v-html for SVG elements #8652

Merged
merged 1 commit into from
Dec 20, 2018
Merged

Conversation

Justineo
Copy link
Member

@Justineo Justineo commented Aug 14, 2018

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Currently for older browsers (IE9~IE11) we cannot use v-html on SVG elements because they don't support innerHTML for SVG elements. While actually we can fix this without much effort and make it “just works”. As innerHTML is defined for Element interface (which SVGElement is derived from) in the latest spec, I think it's reasonable to add this for v-html.

Other information:

Related issues: #5310 #5756

Since it's a browser-specific fix and we don't run tests for IE locally, I created a repo to demonstrate the fix: https://github.com/Justineo/v-html-svg

I've tested and it should now work in IE 9~IE 11.

@Justineo
Copy link
Member Author

It seems that we are waiting for #8601 to pass CI jobs as other latest PRs.

@hiendv
Copy link

hiendv commented Oct 31, 2018

Looking for this to be merged soon.

@yyx990803 yyx990803 changed the base branch from dev to 2.6 December 20, 2018 22:07
@yyx990803 yyx990803 merged commit a981c80 into vuejs:2.6 Dec 20, 2018
@Justineo Justineo deleted the v-html-for-svg branch December 21, 2018 01:45
f2009 pushed a commit to f2009/vue that referenced this pull request Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants