Setting a checkbox as checked with Vue.js

前端 未结 5 1977
清歌不尽
清歌不尽 2020-12-13 09:21

I have been googling and playing with every combination I know but I cannot get my checkboxes to be initialised as checked.

Example:

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 10:20

    I had similar requirements but I didn't want to use v-model to have the state in the parent component. Then I got this to work:

    
    

    To pass down the value from the parent, I made a small change on this and it works.

    
    

提交回复
热议问题