jsoncjf 2017-12-04 10:57 采纳率: 0%
浏览 18235

vue.js+element中,<el-table-column>标签怎样在js中设置颜色属性?

我做的功能是这样的:如果这条数据某个字段被修改了,那么这个字段要显示红色;现在字段名和数据库对比啊啥的都弄好了,就差着色了;但是一直设置不上;有好的方法吗

  • 写回答

2条回答 默认 最新

  • qq_41126602 2017-12-04 11:00
    关注

    showColor: function () {
    var vm = this;
    jQuery('#setTagColor').minicolors({
    control: 'hue',
    defaultValue: this.tag.color,
    position: 'bottom right',
    theme: 'bootstrap',
    change: function (value) {
    vm.tag.color = value;
    if (!value) return;
    }
    });
    }

         mounted: function () {
    if (this.isEdit) {
      this.loadTag({id: this.id});
    }
    else {
      this.showColor();
    }
    

    },
    methods: {
    loadTag: function (params) {
    this.$resource(Config.TAG_SERVICE_URL)
    .get(params)
    .then(function (response) {
    this.tag = response.data;
    this.showColor();
    });
    },
    ……
    }

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置