网站首页 程序开发 iView的Message提示框
iView的Message提示框
编辑时间:2020-01-15 10:07 作者:nllihui6390 浏览量:3367

全局注册iView

import iView from 'iview'
Vue.use(iView)

使用

方式一 在vue组件中使用

this.$Message.info('This is a info tip');
this.$Message.success('This is a success tip');
this.$Message.warning('This is a warning tip');
this.$Message.error('This is an error tip');

方式二 在js文件中使用

import { Message } from 'iview'
Message.info('hello');
Message.success('hello');
Message.warning('hello');
Message.error('hello');

配置

全局配置

main.js

Vue.prototype.$Message.config({
  top: 70,
  duration:2
});

局部配置

局部配置中设置高度无效

this.$Message.info({
    content: 'I'll be gone in 10 seconds',
    duration: 10,
    closable: true
});


来说两句吧
乖,登录后才可以留言!
最新评论