子组件

子组件通过$emit触发父组件中的自定义函数,第一个值为自定义函数名,后面的参数是向父组件传的值

<van-button @click="emitGetList" type="info">搜索</van-button>

emitGetList(){             
   this.$emit('refreshList',this.cityValue,this.amount,this.requires);
 },

父组件

<searchChild @refreshList = 'getDate' ></searchChild>

 getDate(city,industry,Lstyle,amount,requires){
      this.cityValue = city
      this.industry = industry
      this.Lstyle = Lstyle
      this.amount = amount
      this.requires = requires
      this.getList()
},

 

Logo

前往低代码交流专区

更多推荐