vue(emit子组件触发父组件事件)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39237755/article/details/81943829

//子组件

<button class="btn-operate btn-style-main mr10 mb10" @click="insuranceInformation">新增</button>
methods: {
  insuranceInformation () {
    this.$emit('showInsurInformation')
  }
}

//父组件

<insuranceInformations @showInsurInformation="insuranceInformations"></insuranceInformations> //子组件
methods: {
 insuranceInformations () {
  this.innerDialogShowTxt = '添加车辆保险信息'
 },}

猜你喜欢

转载自blog.csdn.net/qq_39237755/article/details/81943829
今日推荐