插件名称 | easy-notify |
---|---|
发布时间 | 2020年8月24日 |
插件作者 | AhmadWaleed |
用于服务器端和客户端通知系统的轻便且易于使用的通知弹出组件。
# Yarn
$ yarn add vue-easy-notify
# NPM
$ npm i vue-easy-notify --save
1.安装并导入vue-easy-notify。
import Vue from 'vue'
import NotifyPlugin from 'vue-easy-notify'
import 'vue-easy-notify/dist/vue-easy-notify.css'
2.注册组件。
Vue.use(NotifyPlugin)
3.将组件添加到模板。
<notifications></notifications>
4.在应用程序上显示一个通知弹出窗口。
this.$notify({
message: 'Notification message.',
type: 'info', // success, warning, error
size:, 'lg' // or 'sm'
timeout: 5000,
showClose: true
})
// OR
this.$notifyInfo('This is info messsage.');
this.$notifySuccess('This is success messsage.');
this.$notifyWarning('This is warning messsage!');
this.$notifyError('This is error messsage!');
官网:https://github.com/AhmadWaleed/vue-easy-notify
演示:https://www.vue365.cn/code_demo.php?id=1858
GitHub下载:https://github.com/AhmadWaleed/vue-easy-notify/archive/master.zip