mint-ui之toast使用(messagebox,indicator同理)

toast为消息提示框,支持自定义位置、持续时间和样式。

方法1   引入整个 Mint UI 组件,并需要再次单独引入Toast组件

  Toast,它并不是一个全局变量,需要先引入 import { Toast } from 'mint-ui'再使用

  Toast(‘提示信息‘);

方法2 引入整个 Mint UI 不再单独引入Toast组件

   官方文档没写,但看下源码的index.js就找得到

     Vue.$messagebox = Vue.prototype.$messagebox = MessageBox;

     Vue.$toast = Vue.prototype.$toast = Toast;

     Vue.$indicator = Vue.prototype.$indicator = Indicator;

   (所有引用插件的源码都在node_modules下面)

   this.$toast('提示信息');

扫描二维码关注公众号,回复: 2012265 查看本文章

猜你喜欢

转载自www.cnblogs.com/yunspider/p/9286490.html