VUEサブコンポーネントは、親コンポーネントに複数の値を渡す
556 ワード
サブアセンブリ
サブコンポーネントは$emitによって親コンポーネントのカスタム関数をトリガーします.最初の値はカスタム関数名で、後のパラメータは親コンポーネントへの値です.
親コンポーネント
サブコンポーネントは$emitによって親コンポーネントのカスタム関数をトリガーします.最初の値はカスタム関数名で、後のパラメータは親コンポーネントへの値です.
emitGetList(){
this.$emit('refreshList',this.cityValue,this.amount,this.requires);
},
親コンポーネント
getDate(city,industry,Lstyle,amount,requires){
this.cityValue = city
this.industry = industry
this.Lstyle = Lstyle
this.amount = amount
this.requires = requires
this.getList()
},