父组件在标签内将参数做好赋值:
:fatherdata="fields.fatherdata" @tosonfun="fathfunc" /> method:{ fathfunc(v){ console.log("子组件传回的值",v); /*变更父组件的值*/ this.fatherdata = v; } } 子组件申明父组件传递参数和给父组件传值,传给父组件的值,自动修改子组件值 @click="unlock" /> /*申明父组件传递过来的值*/ props:{ fatherdata:{ type:String, default:'', } method:{ unlock(){ /*向父组件传值*/ this.$emit('tosonfun','给父组件传的值'); } } }相关内容