父组件通过点击触发向子组件传值

/*父组件中代码*/
<el-button type="primary" @click="handleSearch">查询</el-button>
<LedgerEquipTable class="ledgerEquipTable" ref="tableList"/>/*在父组件注册的子组件*/

<script>
	methods:{
		handleSearch(){
			this.$refs.tableList.sendItem(this.equipCondition,this.branchname)
		}
	}
</script>


/*子组件中代码*/
methods:{
	sendItem(this.equipCondition,this.branchname){
		/*接收参数*/
	}
}
Logo

前往低代码交流专区

更多推荐