插件名称 | vt-notifications |
---|---|
版本号 | v0.4.1 |
发布时间 | 2020年9月24日 |
插件作者 | sansil |
vt-notifications是为Tailwind框架构建的可自定义的无头Vue通知组件。
# Yarn
$ yarn add vt-notifications
# NPM
$ npm i vt-notifications --save
1.导入vt-notifications组件。
import Vue from "vue";
import Notifications from "vt-notifications";
2.全局注册组件。
Vue.use(Notifications);
3.如下创建一个通知弹出窗口或通知组:
<notificationGroup group="myGroup1">
// wrapper box
<notification v-slot="{notifications}">
notification layout
</notification>
</notificationGroup>
<notificationGroup group="myGroup2">
// wrapper box
<notification v-slot="{notifications}">
notification layout
</notification>
</notificationGroup>
...
4.在应用程序上显示通知。
this.$notify({
group: "myGroup1",
title: "Title",
text: "Notification Message",
type: "info" // info, warning
},
5000
);
v0.4.1(03/06/2021)