Subscribe on changes!

The template does not define the corresponding attribute, and assigns a number type directly through el, throw an wran of a string

avatar
Apr 24th 2022

Version

3.2.33

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Define a props of type number and assign it directly to el, throwing a warning that the value is a string and that the value type in state becomes a string

What is expected?

It is a value of type number

What is actually happening?

It is a string

avatar
Apr 24th 2022

This problem is mainly caused by the fact that when I define a test case, I assign a property value through EL and discover that the assignment is wrong. If I do not assign a value through setAttribute first, the value will never be a number, And I think there are scenarios for assigning values through the JS API. image