javascript - Why can vue checkbox be written like this?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-19 10:10:52
0
1
494
<input type="checkbox" name="test_checkbox" :checked1111="test" @click="onClick"> Test
onClick: function (e) {
        
          this.test = e.target.checked
          console.log(this.test)
        
      }

You can write whatever you want in checked1111. Strangely enough, the check function can be realized
or written as

<input type="checkbox" name="test_checkbox" :aaafc="test" @click="onClick"> Test

can realize two-way binding of data test

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
世界只因有你

Because what works is your onClick processing function, you bind whether checked to test in this function, so it is okay if you do not write: checked="test" on the input tag.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!