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] (v-bind?) Syntax for options when nested in v-for

    Help
    1
    2
    327
    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
      steward last edited by steward

      
      <template>
        <div class="stats-search">
            <div v-for="row in statFields"  :key="row.id">
      
              {{row.id}} {{row.label}} {{row.options}}  // PRINTS OK, DATA IS PRESENT
      
              <hr>
            <q-select
              option-value="value"
              option-label="label"
              clearable
              filled
              multiple
              v-model="targets"
              :options="{{row.options}}" <--- SYNTAX?
              :label="'...'"
              >
            </q-select>
            -->
            </div>
        </div>
      </template>
      
      ---
      
      statFields = [ {id: fd.field_id,  label: fd.label, options:fd.options}, ...]
      
      In each statFields, options= [{"label": "Single", "value": "20" },...]
      
      
      :options="{{row.options}}" <--- SYNTAX?  V-BIND (colon)
        Errors compiling template:
        invalid expression: Unexpected token { in
          {{row.options}}
        Raw expression: :options="{{row.options}}"
      	
      options="{{row.options}}" <--- SYNTAX? NO VBIND (colon)
        Errors compiling template:
        options="{{row.options}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
      	
      

      Hope this is clear to a guru.
      I have an array of fields (v-for row) , each is a q-select.

      How d I get the options into the q-select? (row.options)?

      Thanks in advance.

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

        This did the trick:

                :options="row.options"
        

        …and now seems blazingly obvious. Sigh.

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