使用的jquery.liMarquee
<template>
<div class="itemTable">
<div class="itemtitle">预算执行</div>
<div class="listhead">
<div class="item">处室</div>
<div class="item">项目名称</div>
<div class="item">预算数</div>
<div class="item">调整数</div>
<div class="item">执行数</div>
<div class="item">执行率</div>
</div>
<div class="tablelist">
<div class="tablelistitem" v-for="(item,index) in tableData" :key="index">
<div class="tablelistitems">{{ item.type }}</div>
<div class="tablelistitems">{{ item.type }}</div>
<div class="tablelistitems">{{ item.num1 }}</div>
<div class="tablelistitems">{{ item.num1 }}</div>
<div class="tablelistitems">{{ item.num2 }}</div>
<div class="tablelistitems">
<span class="bjs">{{ item.num3 }}</span>
</div>
</div>
</div>
</div>
</template>
<script>
import $ from 'jquery'
import '../../../utils/jquery.liMarquee'
export default {
name: 'itemTable',
components: {},
props: {
id: {
type: String,
default () {
return ''
}
}
},
data () {
return {
tableData: [
{
type: '出差审批',
num1: 3680,
num2: 1640,
num3: '66.66%'
}, {
type: '公务接待',
num1: 1650,
num2: 1326,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}, {
type: '其他事项',
num1: 866,
num2: 787,
num3: '66.66%'
}]
}
},
watch: {},
mounted () {
$('.tablelist').liMarquee({
direction: 'up',
scrollamount: 15,
loop: -1
})
},
methods: {}
}
</script>
<style lang="scss" scoped>
.itemTable {
background: url("../../../assets/item4bg.png") no-repeat;
width: 100%;
height: 100%;
background-size: 100% 100%;
.itemtitle {
position: relative;
height: 10%;
margin-top: 5px;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
font-size: 16px;
font-family: PangMenZhengDao;
font-weight: 400;
color: #FFFFFF;
}
.eltables {
width: calc(100% - 48px);
margin-left: 24px;
}
.listhead {
}
}
.sqs {
font-size: 13px;
font-family: DIN;
font-weight: bold;
color: #00CAFD;
}
.bjs {
font-size: 13px;
font-family: PingFang;
font-weight: 500;
color: #FFFFFF;
background: url("../../../assets/zhixinglvbg.png") no-repeat;
background-size: 67px 23px;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
width: 67px;
height: 23px;
}
.listhead {
height: 42px;
background: rgba(39, 124, 246, 0.3);
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
width: calc(100% - 40px);
margin-left: 20px;
.item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
font-size: 14px;
font-family: PingFang;
font-weight: 500;
color: #FFFFFF;
}
}
.tablelistitem {
height: 42px;
background: rgba(9, 124, 184, 0);
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
width: calc(100% - 40px);
margin-left: 20px;
.tablelistitems {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
flex: 1;
font-size: 13px;
font-family: PingFang;
font-weight: 500;
color: #FFFFFF;
}
}
.tablelistitem:nth-child(2n) {
background: rgba(9, 124, 184, 0.2);
}
.tablelist {
position: relative;
width: 100%;
height: calc(100% - 80px);
}
</style>