vue 父组件通知子组件_一个简单的引导样式的Vue组件用于通知

vue 父组件通知子组件

通知 (Notify)

A simple bootstrap styled Vue component for notifications. Compatible with Vue 2.x

一个简单的引导样式的Vue组件用于通知。 与Vue 2.x兼容

要求 (Requirements)

Required packages:

所需软件包:

  • vue 2+

    Vue 2+

  • velocity-animate 1.5+

    速度动画1.5+

Optional packages:

可选软件包:

  • bootstrap (only used for styling)

    引导程序(仅用于样式设置)

安装 (Install)

$ npm install vue2-notify --save

Then in your main.js:

然后在您的main.js中:

import Notify from '../src/notify'

// Use Notify
Vue.use(Notify)

用法 (Usage)

Inside your component:

在组件内部:

this.$notify('A message that should be displayed', 'type')

or

要么

Vue.$notify('A message that should be displayed', 'type')

You can override the itemClass, iconClass or visibility on a per usage basis:

您可以按使用情况覆盖itemClass,iconClass或可见性:

this.$notify('A message that should be displayed', 'type', { itemClass: 'alert col-6 alert-info', iconClass: 'fa fa-lg fa-handshake-o', visibility: 10000 })

Type should be one of the types defined in the configuration of the component.

类型应该是组件配置中定义的类型之一。

翻译自: https://vuejsexamples.com/a-simple-bootstrap-styled-vue-component-for-notifications/

vue 父组件通知子组件

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值