mardi 14 février 2017

How to solve: inline checked attributes will be ignored when using v-model

I'm creating a component en VueJS and when I created the following checkbox:

<div class="checkbox-inline">
    <label><input type="checkbox" checked="checked" v-model="sendEnter">Send with Enter</label>
  </div><!-- /.checkbox -->

I kept getting error: inline checked attributes will be ignored when using v-model. Declare initial values in the component's data option instead.

But I already had

  data(){
   return{
     textMsg: '',
     sendEnter: 'checked'
   }
  }

In the component. Why I keep getting this error?




Aucun commentaire:

Enregistrer un commentaire