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

    0.15 Notify with HTML

    Help
    10
    25
    5622
    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.
    • N
      Nicholas last edited by

      I’m wondering if there is a way to render HTML inside of the new Notify container?

      In 0.14 we were able to wrap HTML inside of the Alert but from what I have seen, this is not possible in 0.15?

      1 Reply Last reply Reply Quote 0
      • S
        snowdrop last edited by snowdrop

        Same here. @Nicholas this might be off topic but how did you achieve using Notify inside Vue files? I tried this this.$q.notify according to the docs but it’s not working. Using import { Notify } from 'quasar' fixed it.

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

          @snowdrop said in 0.15 Notify with HTML:

          Using import { Notify } from ‘quasar’ fixed it.

          Registering the plug-in inside quasar.conf.js is not sufficient? (moreover it’s the default configuration)

          framework: {
            components: [...],
            directives: [...],
            plugins: [
              'Notify'
            ]
          }
          
          M S 2 Replies Last reply Reply Quote 0
          • J
            jeffatpf last edited by jeffatpf

            Setting an HTML message within Notify and Dialog is a missed feature - lost with the removal of Alert in 0.15 and it’s HTML support. It would be great to get it back.

            N 1 Reply Last reply Reply Quote 2
            • N
              Nicholas @jeffatpf last edited by

              @jeffatef Yes! I can’t tell you how much I miss these features!

              1 Reply Last reply Reply Quote 0
              • M
                MusicForMellons @Akaryatrh last edited by MusicForMellons

                @akaryatrh No this.$q.notify does not work in vue file also not when set properly in quasar.config.js with

                    framework: {
                      components: [
                      ],
                      directives: [
                      ],
                      plugins: [ 'Notify' ],
                
                    },
                

                Any idea why?

                1 Reply Last reply Reply Quote 1
                • M
                  MusicForMellons last edited by MusicForMellons

                  I also used to set background color of toasts with rgba notation, but this does not work anymore with notify…

                  1 Reply Last reply Reply Quote 0
                  • M
                    mds1 last edited by

                    I also miss the ability to add HTML to an alert. Are there any plans to add HTML support to the new Notify component?

                    1 Reply Last reply Reply Quote 0
                    • M
                      mds1 last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • S
                        snowdrop @Akaryatrh last edited by

                        @akaryatrh Yes, setting the Notify plugin inside the quasar.conf.js is not sufficient. I need to declare import { Notify } from 'quasar' in my vue file to make it work.

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

                          If not already done, you guys should open issues on https://github.com/quasarframework/quasar/issues

                          1 Reply Last reply Reply Quote 0
                          • M
                            MusicForMellons last edited by

                            Ok, just did.

                            1 Reply Last reply Reply Quote 0
                            • rstoenescu
                              rstoenescu Admin last edited by

                              1. Installation. Required. http://quasar-framework.org/components/notify.html#Installation
                              2. Usage: http://quasar-framework.org/components/notify.html#Basic-Usage

                              Now, I see following complaints:

                              1. Not supporting HTML markup. Yes, because Quasar needs to make your app be protected from Javascript injection.
                              2. You probably want HTML markup because you need multiple lines. First, according to Material Guidelines, the notification needs to be short. As short as possible. It’s not a full-blown alert message. Having a notification popping up and covering half of the screen defeats its purpose (and it’s also bad UI). Use a Dialog for these cases. Notifications are a “soft” way to inform user something has happened. Add a button to it for “More Info” if you have to. Or use the details prop, but be short with it.
                              3. "I added Notify to quasar.conf.js, but I still need to import it from Quasar". This applies to the usage outside of Vue files. And you need to import it where you use it in this case. How else would you reference the Notify object??? You may ask yourself: but why do I also need to add it to quasar.conf then? You need to understand that Notify is a Quasar Plugin, so it needs to do some initialisation before it can be used. This is why you need it in quasar.conf.js.
                              4. this.$q.notify does not work in a Vue file. I still need to import it from Quasar??". Where are you using this.$q.notify? Inside the Vue component definition, or outside of the export default {...}. Notice the usage of this!! It has meaning inside of the Vue component definition or in your vue template, not outside of it. If you need it before export default {...} then yes, you need the “outside of a Vue file” usage, because your scope is not the Vue component scope…
                              N 1 Reply Last reply Reply Quote 3
                              • M
                                MusicForMellons last edited by

                                Thanks for explanation. Must have messed up something (don’t know what exactly)…, since now it works.

                                I used to use rgba notation for the background (and have opacity feature this way), it seems not possible to set color using rgba notation with notify, correct (and why not…)?

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

                                  Notify only supports colors from the quasar color palette

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    MusicForMellons last edited by

                                    I noticed, and I miss rgba dearly.

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      jeffatpf last edited by

                                      I used the HTML property within Alert to bold the important part of the message, ala “Do you really want to delete <b>whatever</b>?”

                                      1 Reply Last reply Reply Quote 1
                                      • N
                                        Nicholas @rstoenescu last edited by

                                        @rstoenescu thanks for the feedback. But dialog doesn’t support HTML either anymore.
                                        And as mentioned above, I need to use HTML in alerts for emphasis.

                                        1 Reply Last reply Reply Quote 0
                                        • rstoenescu
                                          rstoenescu Admin last edited by

                                          You can always add colors to the palette. http://quasar-framework.org/components/color-palette.html#Adding-Your-Own-Colors

                                          1 Reply Last reply Reply Quote 1
                                          • M
                                            mds1 last edited by

                                            To echo @jeffatef and @Nicholas, I also used the HTML property for emphasis on certain parts of the message. Although I also found it useful for adding hyperlinks within the notification text (I could add a button for this, but I believe a link would provide a better UI in my case). I understand the concerns about Javascript injection, but are there currently any alternative ways to implement these two capabilities into a notification?

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