vue+elementui|vue+elementui el-cascader回填功能

updateChart(id) { this.$http.get('url?id='+id) .then(res => { if (res.data.success === true) { this.dataTableId = res.data.data.dataTableId this.dragTo.values = res.data.data.dragTo this.$refs.hottable.editShowTableMe(res.data.data) this.$http.post('url', {id: this.dataTableId}) .then(response => { this.dataInfo2 = [response.data.data[0].directoryId,this.dataTableId] this.dragFrom.measures = [] this.dragFrom.measures = response.data.data[0].design.schema.measure this.deleteChecked() }) .catch(function(error) { console.log(error) }) } }) .catch(err => { console.log(err) }) }, deleteChecked() { var arr = [] for (let i = 0; i < this.dragFrom.measures.length; i++) { for (let j = 0; j < this.dragTo.values.length; j++) { if ( this.dragFrom.measures[i].column === this.dragTo.values[j].column ) { arr.push(i) } } } for (var k = 0; k < arr.length; k++) { if (k == 0) { this.dragFrom.measures.splice(arr[k], 1)//删除arr[0],删除一个 } else { this.dragFrom.measures.splice(arr[k] - k, 1)//删除arr[0],删除一个,这样判断的意思是一直从第一个开始删除 } } },

【vue+elementui|vue+elementui el-cascader回填功能】

    推荐阅读