[Vuejs]-How to set the accesskey to each one of the button group created by v-for in Vue?

0👍

You can access element index using this syntax: (item, index) in items.
To dynamically bind a property to a component / element, use the : syntax: <a :key="i"></a>.

With your button:

   <button
        v-for="(name, index) in priz"
        :key="index"
        @click="judge(name)"
        class="pure-button button1">
        {{name}}
    </button>

Leave a comment