Points to note about the components of Vue.js study notes (2)

  1. When binding with v-model, do not use this keyword, that is, do not do this: < custome-input v-model = "this.vModelValue "> </ custome-input> , it will invalidate the two-way binding.
  2. Note that when using .native to bind native events to a component: it can only be used on the root element of the component, not on the html native tag. If it is used on the html native tag, the corresponding event will be invalid.
  3. When using v-on to receive a custom method without parameters, this method can be enclosed in parentheses or not, for example: @ click = "jumpToBaidu ()" and @ click = "jumpToBaidu" are all convenient ( @Is short form of v-on)

Guess you like

Origin www.cnblogs.com/code2017/p/7614892.html