Framework suggestion: shorthand for two-way bind



  • if : is shorthand for a v-bind: [one-way bind] how about
    :: implemented as shorthand for a v-model: [two-way bind]

    😀



  • I would argue that it is rather a Vue thing than Quasar.

    Additionally this is a relevant read:
    https://en.wikipedia.org/wiki/Convention_over_configuration

    Personally I think it is a very generous use of “::” symbol just for one semantic use case. In Vue there is a concept of modifiers:

    https://vuejs.org/v2/api/#v-bind

    As for now, you can use default modifiers:

    <button :[key].prop.camel.sync="value"></button>
    

    One would argue, that your proposal of “::” prefix is equivalent to an implementation of a new modifier:

    <button :[key].twoway.reverse.async.anything.andotherthingorelse="value"></button>
    

    Exactly this topic has been discussed and resolved:

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

    As I mentioned earlier, as for now “the official” solution is use of “convention” (mixins/computed/watchers) instead of “configuration” (magic prefixes, modifiers, symbols etc.).

    Hope this helps.



  • You are right. Should not have posted that here. It’s really a Vue thing, not a Q thing.


Log in to reply