不知道为什么,限制input输入长度不生效 #7712
Unanswered
RoadsideParty
asked this question in
Help/Questions
Replies: 1 comment
-
输入 =》 input输入框值变更 =》触发@input事件 =》 msg.vlaue 更新, 视图更新 当输入长度大于5之后,继续在后面输入的话,msg.value是不会更新的,一直都是前五个字符,所以视图也不会进行更新哦,你可以尝试输入超过五个之后再前面输入一个字符 首先你要知道是响应式的值变更才会触发vue的视图更新,你上面所说的视图更新,那个是html原来的表现。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://sfc.vuejs.org/#eNp9kD1uwzAMha9CaFECJFI7dDGcoL2HFtehEwcWJVB0Ohi+e2m7KIoW6Kb3+PTxZzJvObvHiKYydWm5zwIFZcznQH3MiQUmYOxgho5TBKtRGyhQm6gIxHKF01LfWbsP1I3USp8Ibg1dBtzhftKsaMo9mmHEEzpp+IqySVeGvsXd0+FF/86Bar9NoL1VCMY8NIKqAOrb83ma1n7zXHtVq9tTHgWqDW61auF19U52G8FqrvbfKHMw21bH2GR3L4l0b50RIHwVSjAVrM7i6baLDuYmkkvlfena5Vr34hJfvb4cjyR9RIclHt85fRRkBQdz+MHwaj6Qj4x0QUb+j/kr+oe7YPVWs5k/AZdfmuM=
当输入长度达到后,msg没有改变,但视图依旧在改变,而input的value又是绑定的msg的值,照理来说不应该改变
Beta Was this translation helpful? Give feedback.
All reactions