vue+DataV 易懂使用方式

2 篇文章 0 订阅
2 篇文章 0 订阅

DataV 官网

http://datav.jiaminghi.com/
下面拿表格做测试

<template>
  <div class="item">
    <dv-scroll-board
      :config="config"
      style="width: 100%; height: 98%"
      ref="scrollBoard"
    />
  </div>
</template>
<script>
var imgUrl = require("@/assets/image/icon_list_yidj.png");
console.log(imgUrl);
export default {
  data() {
    return {
      config: {},
    };
  },
  components: {},
  mounted() {
    var data = [];
    for (let index = 0; index < 40; index++) {
      data.push([
        `<img src="${imgUrl}">`,
        '<span style="color:#00E5FF;font-size: 14px;">2022-10-08</span>',
        '<span style="color:#00E5FF;font-size: 14px;">行1列2</span>',
        '<span style="color:#00E5FF;font-size: 14px;">行1列25465465677657</span>',
        '<span style="color:#00E5FF;font-size: 14px;">行1列2</span>',
        '<span style="color:#00E5FF;font-size: 14px;">行1列2</span>',
      ]);
    }
    this.config = {
      header: [
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">预警等级</span>',
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">预警时间</span>',
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">预警边坡</span>',
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">具体位置</span>',
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">预警设备名称</span>',
        '<span style="color:#fff;font-size: 18px;font-family: Source Han Sans CN;font-weight: 400;">预警设备类型</span>',
      ],
      data: data,
      rowNum: 10,
      index: true,
      columnWidth: [50, 110, 150, 130, 300, 260, 140],
      align: ["center"],
      headerBGC: "#0a2f49",
      headerHeight: 40,
      waitTime: 2000, // 轮播时间间隔(ms)
    };
  },
  methods: {
    // doUpdate() {
    //   this.$refs["scrollBoard"].updateRows(rows, index);
    // },
  },
};
</script>
  <style scoped lang="scss">
.item {
  width: 100%;
  height: 100%;
  //   border: 1px solid red;
  position: relative;
}
</style>


在这里插入图片描述
带滚动的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值