Use this method when the requirement requires you to determine if a tag has been clicked before executing another method!! Also give yourself a memo!!

Is the tag clicked? Execution method: Executes another method

1. Bind the ref attribute to the tag

<el-button @click="hQuery" ref="clickQuery"> </el-button>Copy the code

2. We can print a _event attribute in the ref attribute, and the function click is the target

console.log(this.$refs.clickQuery)
Copy the code

3. Then you can use it to judge

this.$refs.clickQuery._events.click ? Execution method: Executes another method