Vue, why do you use beforeMount? here?

the original problem is to click on the parent component anywhere to make the child component disappear. There is a big guy"s code that reads and asks him that he didn"t answer, so there are two places I don"t know. I would like to ask you
why this code is written into beforeMount? Didn"t you mount beforeMount at the time? the click event can"t be used, is it? And what is the _ close here?

<template>
 <div @click="none">
      <div id="drop-down">
        <Dropdown v-if="dd"></Dropdown>
      </div>
 </div>
</template>
export default {
  name: "Blog",
  data () {
    return {
      dd: true
    }
  },
  methods: {
    none () {
      this.dd = false
    }
  },

Boss"s component code

beforeMount() {
  this._close = e => {
    // 
    if (this.$el.contains(e.target)) {
      return;
    }
    this.$emit("hide");
  };  
  document.body.addEventListener("click", this._close);
},
beforeDestroy() {
  document.body.removeEventListener("click", this._close);  
}
Jun.19,2021

when beforeMount is not mounted, the click event cannot be used, is it?

binds the click event

of body
and what is the _ close here?

this._close is a es6 arrow function defined to use the external this
to determine whether it is inside the component if it is returned directly inside the component and not handled if it is not triggered inside the component hide event

var that = this;
this._close = function (e) {
    // 
    if (that.$el.contains(e.target)) {
      return;
    }
    that.$emit('hide');
};  
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b384a6-344b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b384a6-344b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?