Parent-child component communication

3. After the internal data of the child component changes, pass the value to the parent component
    3.1, the receiver (shopcart.vue parent component), use v-on to listen for events, and write the handler function
    
    3.2. Value passer (inputnumber.vue subcomponent), use $emit to trigger events and pass payload
    
    Child components pass values ​​to parent components: an object is passed
        {goodsId:87,goodsNumber:3}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325213511&siteId=291194637
Recommended