Vue the solution to the problem when the editing function is used in the project _javascript skills

Source: Internet
Author: User

When you finish editing in your project, you encounter the problem that the editing feature uses a subassembly as a pop-up box, as shown in


This involves the problem of passing data from a parent component to a subassembly. This project uses v1.0, the problem is that when you click on the edit, the pop-up subassembly did not get the data from the parent component, the inspection did not find the code error, the final solution is in the parent component, the passed data in the initialization of each item is good

Creatissue (type,list,id) {
    this.modelissue=true;
    This.modeltype=type;
    if (type== ' creat ') {
     this.listdb.executorname= ';
     This.listdb.executorid= ';
     This.listdb.state= ';
     This.listdb.projverid= ';
     This.listdb.content= ';
     This.issuetitle= "Create problem to";
    } else if (type== ' edit ') {
     this.listdb={...list};   Deconstruction of data, using only the value of the list, not the address of the list
     this.editid=id;
     this.issuetitle= "edit problem";
    }
   ,

This is the method that is executed when you click Edit, and the following is the data passed to the subassembly

listdb:{executorname: ', Executorid: ', State: ',
  projverid: ',
  content: '
},

At the beginning, it just defines an empty data like this:

listdb:{},

In this case, the data will not be passed to the subassembly, and it would be better to define each item to be passed, like the one above.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.