SoFunction
Updated on 2025-04-04

Based on vue v-for loop check box - the implementation method that checks the first one by default

Application scenario: When performing multiple selections, the first one is usually displayed by default.

Implementation method: Pure vue implementation

example:

<span v-for="(one,index) in site"><input type="checkbox" :checked="index == 0" style="vertical-align: middle;"><label>{{}}</label></span>

//:checked="index == 0" is an index of 0, which means adding attributes to the first check box.

expand:The check box that is selected by default is only required to specify the index.

The above article is based on the vue v-for loop check box - the first implementation method is checked by default. It is all the content I share with you. I hope you can give you a reference and I hope you can support me more.