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

fix(types): update the type definition of $el property #8809

Merged
merged 1 commit into from
Dec 1, 2018

Conversation

kaorun343
Copy link
Contributor

to be able to define $el as SVGElement

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:

Other information:

@ktsn
Copy link
Member

ktsn commented Oct 13, 2018

Just a note: this would breaks existing apps which is using $el. The users need to annotate the type to HTMLElement or so by their hand.

@RnbWd
Copy link

RnbWd commented Dec 17, 2018

@ktsn how do you reassign Element to HTMLElement?

edit: this seems to work const element = this.$el as HTMLElement

@kaorun343 kaorun343 deleted the update_types branch December 18, 2018 05:37
@slangeder
Copy link

I am not a fan of this change.
Now I have to cast every $el to HTMLElement when I want to use it.
I worked around by writing a plugin that provides $el casted to HTMLElement as a new property $html.

Does Vue really need to support components / apps on SVG elements?

@LinusBorg
Copy link
Member

Does Vue really need to support components / apps on SVG elements?

This is a 100% yes.

@kjleitz
Copy link

kjleitz commented Jan 29, 2019

This was a breaking change for our build—shouldn't it have been in at least a minor version update, as opposed to a patch update?

@yyx990803
Copy link
Member

@kjleitz yes we should have. It was a mistake to release this in a patch. Apologies if this caused inconvenience on your side.

robinchow added a commit to robinchow/vuejs.org that referenced this pull request Feb 13, 2019
robinchow added a commit to robinchow/vuejs.org that referenced this pull request Feb 13, 2019
As per the original Typescript definitions plus this merged PR: vuejs/vue#8809
sdras pushed a commit to vuejs/v2.vuejs.org that referenced this pull request Feb 18, 2019
Jinjiang pushed a commit to vuejs/v2.cn.vuejs.org that referenced this pull request Feb 18, 2019
Justineo pushed a commit to vuejs/v2.cn.vuejs.org that referenced this pull request Feb 18, 2019
@kjleitz
Copy link

kjleitz commented Mar 19, 2019

@yyx990803 no worries, man! Thank you guys for all your hard work. Vue is amazing.

phanan pushed a commit to phanan-forks/vuejs.org that referenced this pull request Mar 20, 2019
aJean pushed a commit to aJean/vue that referenced this pull request Aug 19, 2020
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.

7 participants