[Solved] How does the new 'Notify' component work in v0.15?



  • Hi, does anyone know how the new Notify component works? I have tried several approaches, but none work for me.
    I have tried the following (following some comments in Gitter on 2 Dec)

    Notify('My Error Message')  // -> TypeError: Object(...) is not a function
    Notify({ message: 'My Error Message' }) // -> TypeError: Object(...) is not a function
    this.$q.notify('My Error Message') // -> TypeError: this.$q.notify is not a function
    Notify.create('My Message') // -> TypeError: cannot read property 'add' of undefined
    

    Please help!



  • I also notice in the source for src/plugins/notify.js, the create function is as follows:

    var notify = {
      create: function create (opts) {
        return this.__vm.add(opts)
      },
    

    but there is another install ({ $q, Vue }) function included below that as well, which implies that the component needs to be installed.

    I have also tried adding a `<q-notification></q-notification> to my template as well.

    Can anyone comment on this?



  • @rstoenescu solved this for me!

    If you are using the v0.15 starter kit ( https://github.com/quasarframework/quasar-starter-kit ), then do it like this:

    -> “add it in quasar.conf > framework > plugins: [ ‘Notify’, …]”

    If you are not using the starter kit, then:

    -> “Then in main.js, import { Notify } from ‘quasar’… then look for Vue.use(Quasar, {plugins: {Notify, …”

    Just putting it out there 🙂