Vue数组改变,视图不更新解决方案
列表渲染 — Vue.jsVue.js - The Progressive JavaScript Frameworkhttps://cn.vuejs.org/v2/guide/list.html#%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9this.$forceUpdate() // 强制刷新Vue.set(Array,index,newValue)// vue本身可以
·
this.$forceUpdate() // 强制刷新
Vue.set(Array,index,newValue)
// vue本身可以监听到数组的一些方法,例如:
// push(),pop(),shift(),unshift(),splice(),sort(),reverse()
Array.splice(index,1,newValue);
更多推荐
已为社区贡献9条内容
所有评论(0)