1: this.$router.query 递参数类型number,刷新后自动转成字符串
解决办法:类型强转
2: Vue不能检测以下变动的数组
- 当使用索引直接改变或者设置一个项时,例如:this.items[index] = newvalue。
- 当修改数组的长度时,例如:this.items.lenght = newValue
解决办法:
第一类解决办法:
// Vue.set
this.$set(this.items, indexOfItem, newValue)
// Array.prototype.splice
this.items.splice(indexOfItem, 1, newValue)
复制代码
第二类解决办法:
vm.items.splice(newLength)