" />

最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue使用動畫實現(xiàn)滾動表格效果

 更新時間:2022年04月11日 15:47:00   作者:qq_33203555  
這篇文章主要為大家詳細(xì)介紹了vue使用動畫實現(xiàn)滾動表格效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了vue使用動畫實現(xiàn)滾動表格效果的具體代碼,供大家參考,具體內(nèi)容如下

需求

在一些大屏項目中,需要使用到表格行數(shù)據(jù)滾動。本文介紹在vue項目中使用動畫實現(xiàn)滾動表格。

vue代碼如下

<template>
? <div style="cursor: default;margin:9px 10px 18px">
? ? <div class="table-header table-row">
? ? ? <div class="table-cell" style="width: 25%">計劃名稱</div>
? ? ? <div class="table-cell" style="width: 40%">核心企業(yè)</div>
? ? ? <div class="table-cell" style="width: 15%">發(fā)行狀態(tài)</div>
? ? ? <div class="table-cell" style="width: 20%;text-align:right">金額(元)</div>
? ? </div>
? ? <div class="table-body">
? ? ? <div :class="{ 'scroll-wrap': getPlayData.length > 0 }">
? ? ? ? <div
? ? ? ? ? class="table-row"
? ? ? ? ? :class="{ hasBgc: index % 2 === 0 }"
? ? ? ? ? v-for="(item, index) in getPlayData"
? ? ? ? ? :key="index"
? ? ? ? ? :ref="'row_' + index"
? ? ? ? >
? ? ? ? ? <div class="table-cell" style="width: 25%" :title="item.productName">
? ? ? ? ? ? {{ item.productName }}
? ? ? ? ? </div>
? ? ? ? ? <div class="table-cell" style="width: 40%" :title="item.coreName">{{ item.coreName }}</div>
? ? ? ? ? <div class="table-cell" style="width: 15%" :title="item.publish">{{ item.publish }}</div>
? ? ? ? ? <div class="table-cell" style="width: 20%;text-align:right" :title="item.publishAmount">
? ? ? ? ? ? {{ item.publishAmount }}
? ? ? ? ? </div>
? ? ? ? </div>
? ? ? </div>
? ? </div>
? </div>
</template>
<script>
export default {
? props: {
? ? data: {
? ? ? type: Array,
? ? ? default: () => {
? ? ? ? return [];
? ? ? },
? ? },
? },
? data() {
? ? return {
? ? ? initMt: 0,
? ? ? // getPlayData:[],
? ? ? visible: true,
? ? ? stop: false,
? ? };
? },
? methods: {
? ? play() {
? ? ? const row = this.$refs["row_0"][0];

? ? ? setTimeout(() => {
? ? ? ? this.visible = false;

? ? ? ? this.$nextTick(() => {
? ? ? ? ? this.initMt++;
? ? ? ? ? if (this.initMt === this.data.length) {
? ? ? ? ? ? this.initMt = 0;
? ? ? ? ? }
? ? ? ? ? this.visible = true;
? ? ? ? });
? ? ? ? this.play();
? ? ? }, 2000);
? ? },
? },
? watch: {

? },
? computed: {
? ? getPlayData() {
? ? ? return this.data.concat(this.data.slice(0, 4));
? ? },
? },
? mounted() {
? ? // this.play();
? },
};
</script>
<style lang="scss" scoped>
$cellHeight: 35px;
.table-row {
? display: flex;
? line-height: 35px;
? height: 35px;
? transition: all 0.3s;
? border-bottom: 1px solid rgba(63, 88, 114, 1);
}
.table-header {
? color: rgba(87, 150, 190, 1);
}
.table-cell {
? text-align: left;
? font-size: 12px;
? text-overflow: ellipsis;
? overflow: hidden;
}
// .hasBgc {
// ? background: rgb(0, 59, 81);
// }
.hidden-row {
? height: 0 !important;
? line-height: 0 !important;
? display: none !important;
}
.table-body {
? height: 142px;
? overflow-y: hidden;
? .table-row {
? ? color: #fff;
? }
}
.scroll-wrap {
? animation: scroll 18s linear infinite;
? position: relative;
}
.scroll-wrap:hover {
? animation-play-state: paused;
}
@keyframes scroll {
? from {
? ? top: 0;
? }
? to {
? ? top: -8 * $cellHeight;
? }
}
</style>

通過動畫動態(tài)改變表格的位置來達(dá)到移動的效果。把數(shù)據(jù)的一半拼接在原數(shù)據(jù)上作為滾動數(shù)據(jù),達(dá)到銜接的效果。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vue 實現(xiàn)輸入框新增搜索歷史記錄功能

    Vue 實現(xiàn)輸入框新增搜索歷史記錄功能

    這篇文章主要介紹了Vue 輸入框新增搜索歷史記錄功能,本文通過實例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-10-10
  • 詳解vue?Router(v3.x)?路由傳參的三種方式

    詳解vue?Router(v3.x)?路由傳參的三種方式

    vue路由傳參的使用場景一般都是應(yīng)用在父路由跳轉(zhuǎn)到子路由時,攜帶參數(shù)跳轉(zhuǎn),本文將詳細(xì)介紹vue路由傳參的三種方式,這三種傳參方式只是針對vue?Router?V3版本的,需要的朋友可以參考下
    2023-07-07
  • Vue+ElementUI實現(xiàn)表單動態(tài)渲染、可視化配置的方法

    Vue+ElementUI實現(xiàn)表單動態(tài)渲染、可視化配置的方法

    這篇文章主要介紹了Vue+ElementUI實現(xiàn)表單動態(tài)渲染、可視化配置的方法,需要的朋友可以參考下
    2018-03-03
  • vue配置別名alias在webstorm不生效問題及解決

    vue配置別名alias在webstorm不生效問題及解決

    這篇文章主要介紹了vue配置別名alias在webstorm不生效問題及解決方案,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • vite+vue3項目中svg圖標(biāo)組件封裝的過程詳解

    vite+vue3項目中svg圖標(biāo)組件封裝的過程詳解

    這篇文章主要介紹了vite+vue3項目中svg圖標(biāo)組件封裝的過程,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧
    2024-03-03
  • 測試平臺開發(fā)vue組件化重構(gòu)前端代碼

    測試平臺開發(fā)vue組件化重構(gòu)前端代碼

    這篇文章主要為大家介紹了測試平臺開發(fā)vue組件化重構(gòu)前端代碼,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-05-05
  • vue中axios給后端傳遞參數(shù)出現(xiàn)等于號和雙引號的問題及解決方法

    vue中axios給后端傳遞參數(shù)出現(xiàn)等于號和雙引號的問題及解決方法

    這篇文章主要介紹了vue中axios給后端傳遞參數(shù)出現(xiàn)等于號和雙引號要怎么解決,項目場景我是傳遞一個string字符給后端時候報錯,隨手把這個問題記錄下來了,需要的朋友可以參考下解決方案
    2022-11-11
  • Vue中ref和$refs的介紹以及使用方法示例

    Vue中ref和$refs的介紹以及使用方法示例

    這篇文章主要給大家介紹了關(guān)于Vue中ref和$refs使用方法的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-01-01
  • Vue項目中env文件的作用和配置詳解

    Vue項目中env文件的作用和配置詳解

    Vue項目中,.env文件是運(yùn)行項目時的環(huán)境配置文件,但是在實際開發(fā)過程中,有本地開發(fā)環(huán)境、測試環(huán)境、生產(chǎn)環(huán)境等,不同環(huán)境對應(yīng)的配置會不一樣,本文給大家介紹了Vue項目中env文件的作用和配置,需要的朋友可以參考下
    2024-12-12
  • 一文詳解Vue響應(yīng)式數(shù)據(jù)的原理

    一文詳解Vue響應(yīng)式數(shù)據(jù)的原理

    在vue2的響應(yīng)式中,存在著添加屬性、刪除屬性、以及通過下標(biāo)修改數(shù)組,但頁面不會自動更新的問題,而這些問題在vue3中都得以解決,本文就給大家詳細(xì)的介紹一下Vue響應(yīng)式數(shù)據(jù)原理,感興趣的小伙伴跟著小編一起來看看吧
    2023-08-08

最新評論

丁青县| 广西| 苏尼特右旗| 调兵山市| 卢龙县| 秀山| 黑山县| 宜城市| 陇川县| 远安县| 青田县| 腾冲县| 筠连县| 岳阳市| 赣榆县| 洛川县| 宣恩县| 万全县| 吉首市| 侯马市| 惠来县| 抚松县| 贡觉县| 盐山县| 霞浦县| 都兰县| 吉林市| 内乡县| 吉隆县| 富裕县| 项城市| 锦屏县| 准格尔旗| 东源县| 乐都县| 安阳市| 石阡县| 鄂尔多斯市| 辽阳县| 肥城市| 林周县|