vue.js api_Vue.js 2使用本机API围绕Noty.js进行包装

vue.js api

告示通知 (vue-notice)

Updated. Fully based on Noty.js API. See Usage instruction.

更新。 完全基于Noty.js API。 请参阅用法说明。

Vue.js plugin accessible globally from any component to run non-blocking notifications.

Vue.js插件可从任何组件全局访问以运行非阻塞通知。

安装 (Installation)

More installation options on noty.js

关于noty.js的更多安装选项

$ npm install noty

Import vue-notice.js in the main project file

在主项目文件中导入vue-notice.js

import Vue from 'vue'
import VueNotice from './vue-notice'

Vue.use(VueNotice)

// Custom config 
Vue.use(VueNotice, {
  timeout: 5000,
  layout: 'topCenter'
})

Download the latest version of styles: noty.css

下载最新版本的样式: noty.css

@import './noty.css';

用法 (Usage)

In your Vue.js components, simply call:

在您的Vue.js组件中,只需调用:

// Success alert
this.$notice({
     type: 'success',  // alert, success, warning, error, info/information
     text: 'Some notification text' 
 })

翻译自: https://vuejsexamples.com/vue-js-2-wrapper-around-noty-js-with-native-api/

vue.js api

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值