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

    Dynamic v-model. Hmm.....

    Help
    2
    7
    808
    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.molinari
      s.molinari last edited by

      I was playing around with slots and trying to make some silly system for a survey and I’m almost there.

      http://jsfiddle.net/smolinari/3zLp4s6n/

      Problem is, the dynamic setting of the v-model isn’t working. I’ve looked everywhere as to how to set this, but could’t find a fitting example. Is this not possible?

      Scott

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        I think the reply here is telling me, ternaries in v-model won’t work. Ok. trying a different method…

        https://github.com/vuejs/vue/issues/8390

        Scott

        1 Reply Last reply Reply Quote 0
        • s.molinari
          s.molinari last edited by

          Ok. This is the solution. I guess. Anyone with a better idea, please let me know.

          http://jsfiddle.net/smolinari/9cdrswov/

          Scott

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

            You can bind value and handle the input event
            https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components

            1 Reply Last reply Reply Quote 0
            • s.molinari
              s.molinari last edited by

              @morlz - thanks but how does that help with the ternary operation not working in v-model? I’m not getting the connection. 😊

              Scott

              M 1 Reply Last reply Reply Quote 0
              • M
                morlz @s.molinari last edited by

                @s-molinari In the getter, you can choose from where you need to get the value, and in the “input” handler, choose where you want to assign it.

                1 Reply Last reply Reply Quote 0
                • s.molinari
                  s.molinari last edited by

                  @morlz - can you possibly show what you mean in the first fiddle above? 😊

                  Scott

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