search

Home  >  Q&A  >  body text

javascript - How to splice vuejs strings and variables

<ul id="example-1">
  <li v-for="(value, key) in items">
        <my-components :options="options"></my-components>    
  </li>
</ul>

According to the traversed data, different parameters are passed to the component. How to achieve this?

For example
When key==0, options=options_0
When key==1, options=options_1

淡淡烟草味淡淡烟草味2751 days ago574

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-19 10:46:04

    <ul id="example-1">
      <li v-for="(value, key) in items">
            <my-components :options="'options_'+key"></my-components>    
      </li>
    </ul>

    reply
    0
  • Cancelreply