<div class="getScore" ref="getScore" :style="{height:height}">
<img :src="imgUrl" alt="" srcset="" id="bg" ref="bgimg">
<div class="content">
<div class="score">
<span>积分</span>
<div class="scorenum">
<span v-for="item in score" :style="{background:scorebg,border:defaultborder,boxShadow:defaultboxshadow}">{{item}}</span>
</div>
<span>积分</span>
</div>
<div class="moreActivity" :style="{background:btnbg}" @click="viewMore">
{{btntext}} <span class="icon iconfont" :style="{color:btnbg}"></span>
</div>
</div>
</div>
</div>
js
mounted() {
var self = this
self.$refs.bgimg.addEventListener('load', function () {
var height = self.$refs.bgimg.offsetHeight;
self.height = height+'px'
})
网友评论