标签:mat v-for eth round math for col back 记录
获取随机色,vue的使用
<view class="slip-item" :style="{background:bgColor}" @tap="selectItem()" @touchstart="touchStart" @touchend="touchEnd" @touchmove="touchMove" v-for="item in 3" :key=‘item‘ > <view class="slip-itemBox"> <view class="slip-head"> {{title}} </view> </view> </view>
mounted() {
this.getColor()
},
methods: {
// 获取随机色
getColor(){
let r = parseInt(Math.random() * 256)
let g = parseInt(Math.random() * 256)
let b = parseInt(Math.random() * 256)
this.bgColor = `rgba(${r},${g},${b},0.3)`
},
}
只是记录,以备后续有需要
标签:mat v-for eth round math for col back 记录
原文地址:https://www.cnblogs.com/aidmjy/p/12119255.html