In the vue project, the vue encountered a problem when performing the editing function to transmit data.
When editing a project, you encounter the following problem: the editing function uses a sub-component as the pop-up box,
This involves the problem of transferring data from the parent component to the child component. This project uses v1.0. The problem is that after you click Edit, the pop-up child component does not obtain the data transmitted by the parent component. No code error is found after the check. The final solution is in the parent component, initialize each item in the passed data.
CreatIssue (type, list, id) {this. modelIssue = true; this. modeltype = type; if (type = 'creat') {this.listdb.exe cutorName = ''; this.listdb.exe cutorId =''; this. listdb. state = ''; this. listdb. projVerId = ''; this. listdb. content = ''; this. issueTitle = "Create Question to";} else if (type = 'edit') {this. listdb = {... list}; // deconstruct data. Only the list value is used, and the list address is not required. this. editId = id; this. issueTitle = "Edit question ";}},
This is the method executed when you click Edit. The following is the data passed to the child component.
listdb:{ executorName:'', executorId:'', state:'', ProjVerId:'', content:''},
At the beginning, only an empty data is defined as follows:
Listdb :{},
In this case, data will not be transmitted to the child component. After defining each item to be passed, it will be fine, just like the above method.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.