共1个回答
EC
游客ecqXMk

你有三种方法设置通知选项:

  1. 在插件初始化时设置
import Notify from 'vue-notifyjs'
Vue.use(Notify, {type: 'primary', timeout: 2000})
  1. 通过setOptions 动态设置
this.$notifications.setOptions({
  type: 'primary', 
  timeout: 2000,
  horizontalAlign: 'right',
  verticalAlign: 'top'
})
  1. 当使用$notify时设置
this.$notify({
  message: 'Welcome',
  type: 'success'
})

注意,使用第3种方法会覆盖前两者设置的选项。

回答问题