Tips:一些记录,一些笔记

2024/07/23
TUESDAY
Education is a progressive discovery of our ignorance.
教育是一个逐步发现自己无知的过程。

01
VisActor VTable
它的官方网站是:
https://visactor.com/
https://visactor.com/vtable

它是由字节跳动(Byte Dance)推出的可视化解决方案「VisActor」中的一个高性能表格组件。
它的Github官方地址:
https://github.com/VisActor/VTable
官方样例库:
https://visactor.com/vtable/example
官方文档:
https://visactor.com/vtable/guide/Getting_Started/Getting_Started
02
安装
首先,使用PNPM安装「VTable」
pnpm install @visactor/vtable
安装好了之后,可以查看安装情况:
(base) adamhuan@Leviathan src % pnpm list | grep vtable@visactor/vtable 1.5.3@visactor/vtable-export 1.5.3(base) adamhuan@Leviathan src %
03
样例:基础表格
代码:
<template>这是「VisActor VTable」表格功能的演示<div ref="listTableRef" style="width: 1280px; height: 400px"></div></template><script setup>import { onMounted, ref } from "vue";import { ListTable } from "@visactor/vtable";const listTableRef = ref();const records = [{1: "李一桐",2: "女",3: 33,4: "处女座",5: "1990-09-06",6: "山东省济南市",7: "北京舞蹈学院",},{1: "赵露思",2: "女",3: 25,4: "天蝎座",5: "1998-11-09",6: "四川省成都市",7: "明道大学",},{1: "包上恩",2: "女",3: 22,4: "双子座",5: "2002-05-23",6: "广东省深圳市",7: "浙江传媒学院表演系",},];const columns = [{field: "1",title: "姓名",width: "auto",},{field: "2",title: "性别",width: "auto",},{field: "3",title: "年龄",width: "auto",},{field: "4",title: "星座",width: "auto",},{field: "5",title: "生日",width: "auto",},{field: "6",title: "出生地",width: "auto",},{field: "7",title: "毕业院校",width: "auto",},];const option = {records,columns,widthMode: "standard",};onMounted(() => {const listTable = new ListTable(listTableRef.value, option);listTable.on("click_cell", (params) => {console.log(params);});});</script><style scoped></style>
页面效果:

在上面的代码中,绑定了一个「click_cell」的事件
来看看它的效果:

END
温馨提示
如果你喜欢本文,请分享到朋友圈,想要获得更多信息,请关注我。
文章转载自Nephilim,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




