quasarframework / quasar-template-meteor

Quasar Starter Kit for Meteor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not use `this.$q.notify('Message')`!

thearabbit opened this issue · comments

Could not use this.$q.notify('Message')!

Error in event handler for "click": "TypeError: this.$q.notify is not a function"

Hi,

notify

Have you installed the Notify plugin in quasar.conf > framework > plugins?

Ah, wait. Should get some sleep. I noticed just now that this is the Meteor repo. Sorry for closing. Disregard my previous message.

Thanks for very quick reply, I base on Meteor.
I used this example repo, and then tried to add Notify

// Home.vue
<q-btn @click="handleNotify">Notify</q-btn>
---
import {  Notify } from "/node_modules/quasar-framework/dist/quasar.mat.esm.js";
...
methods: {
    handleNotify() {
      this.$q.notify.... // don't work
      Notify.create('....'); // don't work
    }
  }

Main.js

...
import Quasar from '/node_modules/quasar-framework/dist/quasar.mat.esm.js';
//import Quasar from '/node_modules/quasar-framework/dist/quasar.ios.esm.js';

Vue.use(Quasar, {});

//App start
Meteor.startup(() => {
    const router = routerFactory.create();
    new Vue({
        router: router,
        render: h => h(AppLayout),
    }).$mount('app');
});

Could help me

import { Notify } from "/node_modules/quasar-framework/dist/quasar.mat.esm.js"
Vue.use(Quasar, {
  plugins: { Notify }
})

It work fine, But I not clear how to use

framework: {
  plugins: ['Notify']
}
---
framework: {
  components: ['QField']
}

What it mean???

could I use global component and plugins?
Like Other UI Framework: Element UI, Vuetify...

Vue.use(UI-Framework)

Could I use config plugins in vue template like components

export default {
  components: {
    QList,
    QListHeader,
    QBtn,
  },
  plugings: [Notify]

I just told you how to register the Notify plugin:

import { Notify } from "/node_modules/quasar-framework/dist/quasar.mat.esm.js"
Vue.use(Quasar, {
  plugins: { Notify } // Notice "plugins" is an Object, not an Array
  components: { ... },
  directives: { ... }
})
``
If you register them globally (like above) then you don't need to import the components, Quasar plugins or directives in each .vue file where you use them.

Hi,

notify

Have you installed the Notify plugin in quasar.conf > framework > plugins?

thank you. it work for me!!!