This.$refs cannot drive the template layer

do such a component

clipboard.png

after the user selects the role, the selected user is used as the query condition to bring out the drop-down value of the technical title.

my approach is to request the interface to get the data from the second drop-down box in the @ change event that selects the role, and then I want to "bind this drop-down data to the current row as an attribute," because clicking the green plus will bring up a new line.

but "bind this drop-down data to the current row as an attribute" I use

this.$refs.operationTable.data[scope.$index].costTypeSelectData = resArry;

this.$refs I found that I can"t drive the template layer, although the current line does have this attribute. The
phenomenon is that there is still no drop-down data for the second technical title after the role has been selected.

Is there any good way to deal with this?


after you set up the data in this way, the data is not responsive, is it? take a look at the Vue.set of the document

https://vuefe.cn/v2/api/-sharpVue-set

< hr >
  https://vuejs.org/v2/api/-sharpvm-set

Menu