Vue multiple selection checkbox how to change the style after it is selected

as shown in the following figure, how to change the style after vue multiple selection checkbox is selected? (without using element ui)

Feb.27,2021

add a click event to checkbox, and change the class of the element when you click. Class can assign values by binding data


input[type="checkbox"]:checked{
    // 
}

css can realize


just use div

<div :class="{selected:key.checked}" v-for="key,index in data" @click="select(key)">
select(){
    if (!key.isChecked) {
      this.$set(key, 'isChecked', true);
      return;
    }
     key.isChecked = !key.isChecked
}

that's about what it means


as mentioned above, use v-bind:class or v-bind:style to change the style.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ee5-2b926.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ee5-2b926.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?