方法一:
子
<el-button @click="secondCahnge()">确定</el-button>
secondCahnge(){
console.log(this.ruleForm,'-')
this.$emit('onSecondChange', this.ruleForm)//事件名,值
}
父
<step-second @onSecondChange='onSecondChange' v-show="active==2"> </step-second>
import StepSecond from "./components/stepSecond.vue"; onSecondChange(e){
console.log(e+'--------')
}
方法二:ref传值
子
<el-form :model="ruleForm" ref="ruleForm" label-width="100px">
父
<step-second ref='second' v-show="active==2"> </step-second>
mounted(){console.log(this.$refs.second.ruleForm,"------");
},