Subscribe on changes!

bind a field containing value using ref, it is no work

avatar
Jul 28th 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNp9UU1rg0AQ/SvTPaUQDU1uqQptyaGFftDmuBfRiTHRXdkPGxD/e2fXxKY0BDzIm/fevDfbsYemCVuLbMkig3VTpQYTLgCimyAAWG9LDfTJPQTBgOdlm3QdZNIKcxe2aWUR+j6aOXwUnnSolFQXpfN/0mh2FiDSmSobA1UqipgzozkDjcY2NCvrRioDHSjcTEGKV+eHOfSwUbIGzqgPZ/dccJFJoc0xK8ROMOnAL14Sr5AyJ9/+lrhnzPmR6WAuRv/J5BbiBDpX5U+FmKKMnr6xMyWxN45mQ5WETakGrdmURbjTUtDJvRdnmaybskL13piSYnC2HLa4WVpV8vvFY0ZZnJ7wbIvZ/gK+0weHcfahUKNq6RLjzKSqQDOMV19veKD/cVjL3FbEvjL8RC0r6zIOtEcrcop9xvNpn/37lKJY69XBoNCnUi6oY/ae79/p6Ur137iLcOF1dFLW/wD34OO/

Steps to reproduce

What is expected?

no error

What is actually happening?

bind a field containing value using ref, it is no work

System Info

TypeError: Cannot read properties of undefined (reading 'value')

Any additional comments?

null

avatar
Jul 28th 2023

ou might be missing that refs are unwrapped in the template?

count2' value is unitially undefined, bzr you try to read a property on it. That will necessarily lead to an error.