I understand that the example I provided is ambiguous and vue can only guess what is meant when writing it like that.
However: If <button> works, <component :is="'button'"> should behave the exact same way. I am fine with both of them leading to recursion but only one is not consistent and also a breaking change
The text was updated successfully, but these errors were encountered:
Fuzzyma
changed the title
component is="" prefers component instead of native element
component is="" prefers component instead over native element
May 30, 2022
Fuzzyma
changed the title
component is="" prefers component instead over native element
component is="" prefers component over native element
May 30, 2022
Vue version
^3.2.34
Link to minimal reproduction
https://sfc.vuejs.org/#__DEV__eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cD5cbmltcG9ydCB7IHJlZiB9IGZyb20gJ3Z1ZSdcbmltcG9ydCBCdXR0b24gZnJvbSAnLi9CdXR0b24udnVlJ1xuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPEJ1dHRvbiAvPlxuPC90ZW1wbGF0ZT4iLCJpbXBvcnQtbWFwLmpzb24iOiJ7XG4gIFwiaW1wb3J0c1wiOiB7XG4gICAgXCJ2dWVcIjogXCJodHRwczovL3VucGtnLmNvbS9AdnVlL3J1bnRpbWUtZG9tQDMuMi4zNi9kaXN0L3J1bnRpbWUtZG9tLmVzbS1icm93c2VyLmpzXCIsXG4gICAgXCJ2dWUvc2VydmVyLXJlbmRlcmVyXCI6IFwiaHR0cHM6Ly91bnBrZy5jb20vQHZ1ZS9zZXJ2ZXItcmVuZGVyZXJAMy4yLjM2L2Rpc3Qvc2VydmVyLXJlbmRlcmVyLmVzbS1icm93c2VyLmpzXCJcbiAgfVxufSIsIkJ1dHRvbi52dWUiOiI8dGVtcGxhdGU+XG4gIDxjb21wb25lbnQgOmlzPVwiJ2J1dHRvbidcIiAvPlxuPC90ZW1wbGF0ZT5cblxuPHNjcmlwdCBzZXR1cD5cbmNvbnN0IGEgPSA2XG48L3NjcmlwdD5cblxuIn0=
Steps to reproduce
Open the link and see the maximum callstack exceeded error
What is expected?
The component should correctly resolve the
<component is="button">
to a native button element as it did for 3.2.33What is actually happening?
The
<component>
tag tries to load theButton.vue
component itself which leads to recursion.Note that the error goes away if you have an empty script tag
System Info
Any additional comments?
I think this is some variant of #6027
I understand that the example I provided is ambiguous and vue can only guess what is meant when writing it like that.
However: If
<button>
works,<component :is="'button'">
should behave the exact same way. I am fine with both of them leading to recursion but only one is not consistent and also a breaking changeThe text was updated successfully, but these errors were encountered: