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

    Dialog enhancement

    Help
    2
    3
    1015
    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
      Sfinx last edited by

      Hi,

      It is difficult to access the Vue object (this) from the Dialog object. It will be good to pass this object to the .create() implicitly. So simple things can be achievable much easier:

      …
      methods: {
      about () {
      Dialog.create({
      title: ‘About’,
      message: ‘Some about message’,
      onDismiss (caller) {
      caller.$refs.menu.close()
      }
      })
      }
      …

      Rus

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

        Use ES6 at its max:

        methods: {
        about () {
        Dialog.create({
        title: ‘About’,
        message: ‘Some about message’,
        onDismiss: () => { // <<<<<<<<
        this.$refs.menu.close() // <<<<<<<
        }
        })
        }

        You can read about arrow functions and pay close attention to closures.

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

          Wow ! Thanks ! It works now 😉

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