Article From:

We know that the basic usage of this thing is like this:

1 this.$message({
2           message: 'Congratulations, this is a success story. ',
3           type: 'success'
4 });

But I think this is still a bit troublesome, so I decided to directly plug it into the prototype of Vue.


Vue.prototype.$elementMessage = function (msg,t) {
    message: msg,
    type: t

When used:

this.$elementMessage('Please fill in the numbers! '','warning')

This is it。

Leave a Reply

Your email address will not be published. Required fields are marked *