zoukankan      html  css  js  c++  java
  • vue中渲染页面,动态设置颜色

    for循环中动态设置页面的图标或者字体颜色与循环中且套循环 

    :style="{'color':items.color}"

    案例代码:

      html中

    <div class="allFunction" v-for="(item,index ) in checksMes">
      <div class="titMes" data-index="dictionaries">
        {{item.menu.menuTitle}}
      </div>
      <div id="addBtn" v-for="(items,indexs ) in item.funcList" >
          <Icon class="iconCommon" :style="{'color':items.color}" :type="items.type"></Icon><span>{{items.funcName}}</span> <span class="triangle"></span><Icon     class="imgIcon" type="checkmark-round"></Icon>
      </div>
    </div>
    js中
    <script type="javascript">
    export default {
        data () {   
           mainMessage:[ //原始数据类型
            {
            "menu": {
              "id": 2,
              "menuId": "test1",
              "menuParentId": "test",
              "menuPath": null,
              "menuIcon": null,
              "checks":"0",
              "menuTitle": "测试菜单1",
              "menuPage": null,
              "menuValid": null,
              "menuOrder": null,
              "menuCreateTime": null,
              "menuUpdateTime": null
              },
          "funcList": [  
              {
              "id": null,
              "funcId": "deleteBtn",
              "funcName": "删除",
              "type":"trash-a",
              "color":"red",
              "funcDesc": "1"
              }
            ]
          }
        ]
      }
    }
    </script>
     
  • 相关阅读:
    调度算法的评价指标
    进程调度的时机 切换与过程调度方式
    处理机调度 概念和层次
    线程概念 多线程模型
    进程通信
    进程的状态与转换
    进程的定义
    系统调用
    面试题3
    第2章Arduino UNO板结构说明
  • 原文地址:https://www.cnblogs.com/ericLJ/p/9056122.html
Copyright © 2011-2022 走看看