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

    [Solved] TypeError: this.$q.dialog(...).then is not a function

    Framework
    1
    3
    2322
    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.
    • S
      Steve L. last edited by Steve L.

      Trying to use the Dialog plugin. Installed the plugin in quasar.conf.js as explained in the doc:
      framework: {
      plugins: [‘Dialog’]
      }

      Tried with a simple example:

      this.$q.dialog({
      title: ‘Confirm’,
      message: ‘Do you want to save this session?’,
      ok: true,
      cancel: true,
      }).then(() => {
      this.$q.notify(‘Agreed!’)
      }).catch(() => {
      this.$q.notify(‘Disagreed…’)
      })

      I did get the dialog popup. But in the development console, I keep getting 2 error messages:

      [Vue warn]: Error in v-on handler: "TypeError: this.$q.dialog(…).then is not a function"

      found in

      —> <QBtn>
      <QPage>
      <PageIndex> at src/pages/Index.vue
      <QPageContainer>
      <QLayout>
      <MyLayout> at src/layouts/MyLayout.vue
      <App> at src/App.vue
      <Root>

      “TypeError: this.$q.dialog(…).then is not a function”

      Did I miss something? I’m using quasar - 1.5.1.

      Thanks

      1 Reply Last reply Reply Quote 0
      • S
        Steve L. last edited by

        I just realized that I was reading the older version documentation 0.17.20 instead of the latest. Going to try out the new onOK() chain method instead of the .then()

        1 Reply Last reply Reply Quote 0
        • S
          Steve L. last edited by

          SOLVED.
          Need to use:
          this.$q.dialog({
          title: ‘Confirm’,
          message: ‘Do you want to save this session?’,
          ok: true,
          cancel: true,
          }).onOk(() => {})

          instead of

          this.$q.dialog({
          title: ‘Confirm’,
          message: ‘Do you want to save this session?’,
          ok: true,
          cancel: true,
          }).then(() => {})

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