VUE学习二【样式,列表,筛选,排序】


1. class 绑定: :class='xxx'

表达式是字符串: 'classA'

表达式是对象: {classA:isA, classB: isB}

表达式是数组: ['classA', 'classB']

2. style 绑定

style="{ color: activeColor, fontSize: fontSize + 'px' }"

 

VUE学习二【样式,列表,筛选,排序】_第1张图片

 

 

 

if="ok">表白成功

else>表白失败

求婚成功

求婚失败


测试: v-for 遍历数组

  • for="(p, index) in persons" :key="index">{{index}}--{{p.name}}--{{p.age}} -- --

测试: v-for 遍历对象

  • for="(value, key) in persons[0]">{{ key }} : {{ value }}

 


    
        
    
    
        
  • for="(p, index) in filterPerson">{{index}}--{{p.name}}--{{p.age}}

 

你可能感兴趣的:(VUE学习二【样式,列表,筛选,排序】)