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

mac2024-04-14  41

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

/*父组件中代码*/ <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){ /*接收参数*/ } }
最新回复(0)