No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Using notify (especially in Laravel) (v0.15.2)

    Framework
    4
    5
    1614
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      psychonetic last edited by

      I am trying to use the new notify component in my laravel project.
      But nothing works:
      import {Notify} from “quasar-framework/dist/quasar.mat.esm”;
      If I try to use it like described in the documentation: Notify.create(‘bla’) nothing happens. No notification and no errors.

      Importing via import {Notify} from ‘quasar’ has never worked for any component (also before v0.15). I always needed to say from ‘quasar-framework’ or now in v0.15 'from “quasar-framework/dist/quasar.mat.esm”;

      Any idea?

      1 Reply Last reply Reply Quote 0
      • Akaryatrh
        Akaryatrh last edited by

        Importing via import {Notify} from ‘quasar’ has never worked for any component (also before v0.15). I always needed to say from ‘quasar-framework’ or now in v0.15 'from “quasar-framework/dist/quasar.mat.esm”;

        Well, as someone pointed out here, import { Notify } from 'quasar should work: http://forum.quasar-framework.org/topic/1852/0-15-notify-with-html/2

        Still, i’m trying to understand how quasar succeed to resolve the dependency. As well, on root of a quasar projet, a .quasar folder is created with a file called entry.js there. As well, I don’t get how components are resolved from quasar dependency. Maybe @rstoenescu could explain us?

        a47ae 1 Reply Last reply Reply Quote 0
        • benoitranque
          benoitranque last edited by

          make sure you add Notify in quasar.conf.js:

          module.exports = function (ctx) {
            return {
              framework: {
                plugins: [ 'Notify' ]
              }
            }
          }
          

          Then in any .vue file:

          this.$q.notify('hello!')
          
          1 Reply Last reply Reply Quote 0
          • a47ae
            a47ae @Akaryatrh last edited by

            @akaryatrh If you are interested in why import * from quasar works take a look here https://github.com/quasarframework/quasar-cli/blob/dev/lib/build/webpack-config.js#L87

            When you run quasar build, the Quasar CLI calls Webpack in order to bundle the files. In the versions before 0.15 the Webpack Config was explicitly written in the build folder. Since 0.15 the Webpack config is now provided by quasar-cli and merged with your changes during build.

            What you see in the line posted above is a so called Webpack alias. This allows for shorthand notations which will then be resolved by Webpack. So every time Webpack encounters quasar in an import statement it is replaced by the path to the quasar source.

            You can learn more about this feature here:
            https://webpack.js.org/configuration/resolve/

            Thanks to being able to extend the Webpack config in quasar.config.js you can even write your own aliases.

            1 Reply Last reply Reply Quote 0
            • Akaryatrh
              Akaryatrh last edited by

              Hi @a47ae
              Thx for pointing the webpack conf of the CLI, i didn’t noticed these aliases 🙂

              1 Reply Last reply Reply Quote 0
              • First post
                Last post