Passing Parent Function to Child Component in VueJS

后端 未结 1 1083
萌比男神i
萌比男神i 2021-02-18 13:32

I\'m having my practice in VueJS 1.0 and I am learning about Components. in this example, there is an input element and has to supply coupon

相关标签:
1条回答
  • 2021-02-18 13:59

    You should bind the property:

    <coupon v-bind:when-applied="setCoupon"></coupon>
    

    or you could use the shorthand syntax for v-bind:

    <coupon :when-applied="setCoupon"></coupon>
    

    Read more about the props here.

    0 讨论(0)
提交回复
热议问题