vue 2.0 动态生成字体颜色

html;
 

 {{from.checkCode}}

data:

 data() {
    return {
     
      codeColor: ""
    };
  },
  randomColor() {
      let R = Math.floor(Math.random() * 255);
      let G = Math.floor(Math.random() * 255);
      let B = Math.floor(Math.random() * 255);
      console.log("rgb(" + R + "," + G + "," + B + ")");
      this.codeColor = "rgb(" + R + "," + G + "," + B + ")";
    }

 

你可能感兴趣的:(vue2.0)