About the manual shutdown of element message

the element message component cannot be closed manually.

The
method
calls Message or this.$message to return an instance of the current Message. If you need to shut down the instance manually, you can call its
close method.

method name
close closes the current Message

this.$message({
  message: "",
  duration: 0,
  showClose: true,
  type: "warning"
})

I can"t close this prompt box by using this.$message (). Close () or this.$message.close () and ask the bosses to answer ~

< hr >

what I use in mounted

mounted () {
    this.$message({
      message: "",
      duration: 0,
      showClose: true,
      type: "warning"
    })
    // this.$message().close()
    this.$message.close()
}

this pop-up box still cannot be closed.

Sep.01,2021

clipboard.png
is very clear. I'll give you an example once.
if you don't believe me, you can try it

.
console.log(this.$message()===this.$message());// false

so the question is also very simple.

const m = this.$message({
  message: '',
  duration: 0,
  showClose: true,
  type: 'warning'
});
// 
setTimeout(()=>m.close(),1000)

or if you don't want to hold an instance reference and there is only one instance on the current page that is not afraid of misoperation, use the static method closeAll

.
this.$message.closeAll()

this.$message.close()

this.$message.close () should be like this

Menu