Vue父子組件傳值的方法

1.父向子傳值props 父組件:<child :inputName="name"> 子組件: (1)props: {    inputName: String,    required: true   } (2)props: ["inputName"] 2.子組件向父組件傳值$emit 子組件:  <span>{{childValue}}</span>  <!-- 定義一個子組件傳值的方法 --
相關文章
相關標籤/搜索