直接赋值有问题的情况下(不能及时赋值及input文本不能编辑),可以使用JSON转换成变量,再用this.$set 赋值给数组
protocolChange(row, index, rows) {
var temp = JSON.parse(JSON.stringify(row))
if (row.protocol && (row.protocol == '6' || row.protocol == '17')) {
temp['sourcePort'] = '1:65535'
temp['destinationPort'] = '1:65535'
// row.destinationPort = '1:65535'
this.$set(rows, index, temp)
}else {
temp['sourcePort'] = null
temp['destinationPort'] = null
this.$set(rows, index, temp)
// row.sourcePort = null
// row.destinationPort = null
// this.$set(row, idx, temp)
}
},