Vue一些需要记住的指令/属性


 

  • v-once:只能使得组件解析执行一次的指令,如:

{{count}}


  

{{count}}

  • v-html:可以解析变量中的html代码块,如:

  • v-pre:不进行解析直接展示原本的内容,如:

{{message}}

{{message}}

  • V-bind:动态绑定属性(v-bind的语法糖:v-bind:src="imgUrl"等价于:bind:src="imgUrl")
  • computed 计算属性:类似于method但不同于method,如:
 

{{fullName}}

{{fullName2}}

  • v-on 事件监听,如:
 
  • 事件监听的修饰符
 
haha
  • v-show的使用,如:
 
  • v-for数组遍历,如:
 
  • for="(item,index) in movies">No {{index+1}} is {{item.name}}

  • for="(value,key) in movies[0]">the movie's {{key}} is {{value}}

sum

{{message}}
vue