Open IlyaSemenov opened 4 weeks ago
<TonConnectButton>
in Vue 3 generates invalid HTML attribute:<div id="ton-connect-button" attrs="[object Object]" style="width: fit-content;">
This is probably caused by this:
I guess the second
attrs
is for Vue 2 compatibility? If so, it should be conditionally added with some kind ofisVue2()
helper.
1、Your guess is correct, because the inheritattrs attribute of the vue component is false by default. If the attrs attribute is assigned at this time, an attrs="[object Object]" tag will be bound to the div. If inheritattrs is set to true, the attrs="[object Object]" tag will disappear, and the corresponding attributes will be inherited on the div.
2、I don't think this is a bug, it's just a problem of attribute inheritance. Do you want to support attribute inheritance on the div?
<TonConnectButton>
in Vue 3 generates invalid HTML attribute:<div id="ton-connect-button" attrs="[object Object]" style="width: fit-content;">
This is probably caused by this: https://github.com/TownSquareXYZ/tonconnect-ui-vue/blob/ee614c6b09efb3a9ef200887882a88de32a300d6/src/components/TonConnectButton.vue#L27-L35
I guess the second
attrs
is for Vue 2 compatibility? If so, it should be conditionally added with some kind ofisVue2()
helper.
1、Your guess is correct, because the inheritattrs attribute of the vue component is false by default. If the attrs attribute is assigned at this time, an attrs="[object Object]" tag will be bound to the div. If inheritattrs is set to true, the attrs="[object Object]" tag will disappear, and the corresponding attributes will be inherited on the div.2、I don't think this is a bug, it's just a problem of attribute inheritance. Do you want to support attribute inheritance on the div?
I‘m sorry,My answers 1 and 2 are inaccurate. This issue has nothing to do with attribute inheritance, and inheritattrs is true by default. Attrs is the value assignment method of vue2. I will re-process it here.
I don't think this is a bug
Emitting attrs="[object Object]"
(this is literal HTML) is definitely a bug. This should not be happening.
I don't think this is a bug
Emitting
attrs="[object Object]"
(this is literal HTML) is definitely a bug. This should not be happening.
Ok, We'll handle it quickly @IlyaSemenov
<TonConnectButton>
in Vue 3 generates invalid HTML attribute:This is probably caused by this:
https://github.com/TownSquareXYZ/tonconnect-ui-vue/blob/ee614c6b09efb3a9ef200887882a88de32a300d6/src/components/TonConnectButton.vue#L27-L35
I guess the second
attrs
is for Vue 2 compatibility? If so, it should be conditionally added with some kind ofisVue2()
helper.