1: this.$router.query passes the parameter type number, which will be automatically converted to a string after refresh
Solution: Type forced transfer
2: Vue cannot detect the following changed arrays
- When using the index to directly change or set an item, for example: this.items[index] = newvalue.
- When modifying the length of the array, for example: this.items.lenght = newValue
Solution:
The first type of solution:
// Vue.set
this.$set(this.items, indexOfItem, newValue)
// Array.prototype.splice
this.items.splice(indexOfItem, 1, newValue)
复制代码
The second type of solution:
vm.items.splice(newLength)