vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
45.6k stars 8k forks source link

When in dev mode, modifying constants declared with const using v-model does not result in an error. #11265

Open GuoJikun opened 2 days ago

GuoJikun commented 2 days ago

Vue version

3.4.31

Link to minimal reproduction

https://play.vuejs.org/#eNp9kUFrwzAMhf+K8GUtdAlddypJYBs9bIdtbDsKRkjVNJ1jG9tJCyH/fbJLux5GD4H4fc/WkzSIB2OSviOxFJmrbGM8OPKdKVA1rdHWwwD70ldbGGFjdQs3bL5BharSynloXQ05oJjfLVCgitbJZJoXgcygL2VeDKgAgl1LSqSuJ6xOUY38ZemxKJfjg6fWyNITnwCy7bwYhlhgHLOUT1FtlOk89LetXpPMUTBHASnDLL24L2bCO665aepk57Ti/mIMFJVuTSPJvhnfcCYUS4gksFJKvX+JmrcdzU56taXq5x995w5BQ/FuyZHtCcWZ+dLW5I949flKB/4/Q07fSXZfgR/E8+pCxqPtsVNrjn3hi2mf45YaVX+51cGTcqemQtDgHKMfBe/t6Urrf3EXyX28xxviKX73ZMObPEAGyWIuxl9Bs7k0

Steps to reproduce

Enter content in the input element of the example.

What is expected?

It throws the same error as in prod mode.

What is actually happening?

When in dev mode, modifying constants declared with const using v-model does not result in an error.

## 了解中文可以看这里
- 使用 const 声明常量
- 在input元素上使用v-model绑定这个常量
- 在 input 元素中输入内容(正常应该报错)

初步判断是由于dev模式和prod模式下编译后的代码不一致导致的

System Info

No response

Any additional comments?

No response