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

    Error Dialog is defined but never used

    Help
    3
    12
    2108
    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
      ninafar last edited by

      Heloo Im a beginner trying to use q-dialog but am I getting that error ?
      Did I miss anything ?

      1 Reply Last reply Reply Quote 0
      • N
        ninafar last edited by

        i still stuck . anyone?

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

          You need to show your code so other can help.

          1 Reply Last reply Reply Quote 0
          • N
            ninafar last edited by ninafar

            ![alt text](image url)0_1530002239331_dialog.png

            1 Reply Last reply Reply Quote 0
            • N
              ninafar last edited by

              i commented the import Dialog because it keep causing me error?

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

                I don’t think it’s appropriate to be putting it in your data () function. Create a function in your methods: and call it from there.

                    onSetHomePosition: function () {
                      this.$q.dialog({
                        color: 'teal-6',
                        title: 'Warning',
                        message: `Permanently replace the Home Position for '${this.cameraItem.data.name}'?`,
                        ok: 'YES',
                        cancel: 'NO'
                      })
                        .then(() => {
                          // user selected ok
                          this.$emit('setHomePosition', this.cameraItem)
                        })
                        .catch(() => {
                          // user selected cancel
                        })
                    }
                
                1 Reply Last reply Reply Quote 0
                • N
                  ninafar last edited by

                  Did you import the Dialog component after script tag ?

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

                    in quasar.conf.js add 'Dialog' to the plugins: array:

                          // Quasar plugins
                          plugins: [
                            'Dialog',
                            'Notify',
                            'AppFullscreen'
                          ]
                    
                    1 Reply Last reply Reply Quote 0
                    • N
                      ninafar last edited by

                      0_1530152069501_import dialog.png 0_1530152078376_dialog ahndler methods.png 0_1530152085281_plugin.png

                      Do i need to include import dialog as shown in the first picture ? cause its the one causing this error 0_1530152417114_eror dialog.png

                      what did i do wrong ?

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

                        @ninafar You don’t have to import Dialog in your components, you can just use this.$q.dialog and if you want to use Dialog in the externas js files than you have to import it.
                        As the documentation said

                        // outside of a Vue file
                        import { Dialog } from 'quasar'
                        (Promise) Dialog.create(configObj)
                        
                        // inside of a Vue file
                        (Promise) this.$q.dialog(configObj)
                        

                        https://quasar-framework.org/components/dialog.html

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

                          Just remove the import of Dialog as you have made it available as a Quasar plugin, meaning it is not accessible via this.$q.dialog.

                          1 Reply Last reply Reply Quote 0
                          • N
                            ninafar last edited by

                            Its working fine now . Thank you, gentlemen! 😃

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