原因
我把 vuex 全局变量 $store.state.search.key 绑定到 v-model 上,
然后在页面挂载时通过代码修改 $store.state.search.key 的值,
最后在页面上输入任意值 input 框就卡住了
解决方法
- input 标签增加 @input 属性
<input v-model='$store.state.search.key' @input="forceUpdateInput">
- methods 中增加对应方法
forceUpdateInput(){this.$forceUpdate();}