element message plus
1.0.0
ElementUI Message
component enhancement
At the same time, component instances of the same type
and message
are only allowed to be created once.
Resolving multiple identical messages will create duplicate displays
pnpm install element-message-plus
import Vue from "vue" ;
import App from "./App.vue" ;
import ElementUI from "element-ui" ;
import "element-ui/lib/theme-chalk/index.css" ;
import MessagePlus from "element-message-plus" ;
Vue . config . productionTip = false ;
Vue . use ( ElementUI ) ;
Vue . use ( MessagePlus ) ;
new Vue ( {
render : ( h ) => h ( App ) ,
} ) . $mount ( "#app" ) ;
Default configuration, replace the default $message
Vue . use ( MessagePlus ) ;
Custom mount, you can customize the location of global mount
Vue . use ( MessagePlus , { target : "$Message" } ) ;
Parameter type ElMessageOptions
, consistent with official documentation
...
import { MessagePlus } from "element-message-plus" ;
...
MessagePlus ( ) ;
MessagePlus . info ( ) ;
MessagePlus . success ( ) ;
MessagePlus . warning ( ) ;
MessagePlus . error ( ) ;
MessagePlus . closeAll ( )
Parameter type ElMessageOptions
, consistent with official documentation
this . $message ( ) ;
this . $message . info ( ) ;
this . $message . success ( ) ;
this . $message . warning ( ) ;
this . $message . error ( ) ;
this . $message . closeAll ( ) ;