如何在 vue.js 中为通知添加样式?

Posted

技术标签:

【中文标题】如何在 vue.js 中为通知添加样式?【英文标题】:How do i add a style to notifications in vue.js? 【发布时间】:2022-01-06 23:04:13 【问题描述】:
this.$notify(
        title: 'İşlem Başarılı',
        message: 'REQUEST SUCCESSFULLY SAVED',
        type: 'success',
        classes: 'notfClas'
      )

当我添加一个类时,它看不到它。如何为通知添加样式?

【问题讨论】:

【参考方案1】:

如果您使用vue-notifications package,您可以通过described here 的组件属性管理它的设置(包括类列表)。喜欢:

<notifications classes="your-class-name"/>

还有一个小例子可能有用http://vue-notification.yev.io/

【讨论】:

我正在使用 Element UI。它不能那样工作。【参考方案2】:

classes 更改为customClass

属性:customClass

描述:通知的自定义类名

https://element.eleme.io/#/en-US/component/notification

【讨论】:

以上是关于如何在 vue.js 中为通知添加样式?的主要内容,如果未能解决你的问题,请参考以下文章