随机生成颜色

  /**
     * 随机生成图标
     */
    test(type) {
      var arr = [
        { colorName: "analysis", colorBgc: "#42C28F" },
        { colorName: "artificial_intelligence", colorBgc: "#FA6669" },
        { colorName: "atom", colorBgc: "#F6C242 " },
        { colorName: "bookmark", colorBgc: "#509CF9" }
      ];
      let row = arr[Math.floor(Math.random() * arr.length)];
      if (type == 1) {
        return row.colorBgc;
      } else {
        return row.colorName;
      }
    },

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页