Awesome Notifications库的Vue.js版本

Vue很棒的通知 (Vue Awesome Notifications)

It's a Vue.js version of Awesome Notifications library. Awesome Notifications is a lightweight JavaScript library for notifications.

这是Awesome Notifications库的Vue.js版本。 Awesome Notifications是一个用于通知的轻量级JavaScript库。

Vue-Awesome-Notifications

安装 (Install)

Attention! This library uses FontAwesome icons, so you either need to make sure that FontAwesome is connected to your project, either disable icons, passing the icons: {enabled: false} property to options. Also you can preserve icons, setting up a custom template for them via editting options.icons.template

注意! 该库使用FontAwesome图标,因此您要么需要确保FontAwesome已连接到您的项目,要么禁用图标,然后将icons: {enabled: false}属性传递给选项。 您还可以保留图标,并通过编辑options.icons.template为它们设置自定义模板options.icons.template

npm install --save vue-awesome-notifications

In main.js

在main.js中

import Vue from "vue"
import VueAWN from "vue-awesome-notifications"

Vue.use(VueAWN, options)

In any of your files:

在您的任何文件中:

this.$awn.success("Your custom message")

默认样式的用法 (Usage of default styles)

For easier customization, SCSS version is preffered.

为便于自定义,建议使用SCSS版本。

With SCSS - In your App.vue

使用SCSS-在您的App.vue中

<style lang="scss">
@import '~vue-awesome-notifications/dist/styles/style.scss';
</style>

With CSS - In your App.vue

使用CSS-在您的App.vue中

<style lang="css">
@import 'vue-awesome-notifications/dist/styles/style.css';
</style>

Or in main.js

或在main.js中

require("vue-awesome-notifications/dist/styles/style.css")

**

**

翻译自: https://vuejsexamples.com/a-vue-js-version-of-awesome-notifications-library/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值