数据类型发生改变
Version
3.0.5
Reproduction link
https://github.com/niefufeng/vue3-datatype-bug-demo
Steps to reproduce
- yarn build
- 访问 dist/index.html
- 点击页面上的 toggle 使表单隐藏(在此之前可以尝试点击下拉框切换值,但是类型始终是 number )
- 再次点击页面伤的 toggle 使表单展示
- 点击下拉框切换值,此时数据类型会从 number 变为 string
What is expected?
值的类型应该永远是 number
What is actually happening?
值的类型从 number 变为了 string
- 该 bug 只会在对子组建使用
v-if
时会出现 - 该 bug 只会在 build 过后出现,dev 模式下不会出现
ref
和reactive
均会出现该 bug
This issue has the same reason as https://github.com/vuejs/vue-next/issues/3072, and will be fixed in https://github.com/vuejs/vue-next/pull/3080