vue随机姓名

getName(event) {
let colors = [‘red’, ‘orange’, ‘green’, ‘blue’, ‘pink’, ‘purple’];
let k = parseInt(Math.random() * colors.length);
let color = colors[k];
let names = this.userNameLists;
let l = parseInt(Math.random() * names.length);
let name = names[l];
this.blingColor = color;
this.showedMessage = name;
this.clientX = event.clientX + ‘px’;
this.clientY = event.clientY + ‘px’;
let that = this;
that.showMessage = true;
setTimeout(function () {
that.showMessage = false
}, 1000);
},

你可能感兴趣的:(vue随机姓名)