vue.js组件数据绑定_Vue.js的增强的数据透视表组件
vue.js组件数据绑定
VUE数据透视表加 (vue-pivot-table-plus)
A customized vue component for pivot table.
数据透视表的定制vue组件。
This project is modified based on vue-pivot-table to adjust its design to our products and add custom features described below.
根据vue-pivot-table修改了此项目,以根据我们的产品调整其设计并添加以下描述的自定义功能。
定制功能 (Customized features)
Used
v-model
to bind row / column fields使用
v-model
绑定行/列字段- And get these states reactively并React性地获得这些状态
Reset row / column fields
重置行/列字段
Download the current pivotted table in CSV / TSV
下载CSV / TSV中的当前数据透视表
Sortable rows
可排序的行
Design updates
设计更新
- Shrinked buttons and table缩小的按钮和桌子
安装 (Install)
npm install --save vue-pivot-table-plus
(temp)
npm install --save vue-pivot-table-plus
(temp)
用法 (Usage)
The component Pivot
has an aggregation table (referred to as PivotTable
) from data & specific rows/columns.
组件Pivot
具有来自数据和特定行/列的聚合表(称为PivotTable
)。
Pivot
has also a drag & drop user interface to configure rows/columns of a PivotTable
.
Pivot
还具有拖放用户界面,以配置PivotTable
表的行/列。
<!-- App.vue (template) -->
<template><div id="app">...<pivot:data="data"v-model="fields":reducer="reducer":showSettings="defaultShowSettings"></pivot>...</template>
/* App.vue (js)*/
// Import the needed component(s)
import Vue from 'vue'
import { Pivot } from 'vue-pivot-table-plus'export default Vue.extend({name: "app",components: { Pivot },data: () => {return {data: Object.freeze([{ x: 0, y: 0, z: 0 }, { x: 1, y: 1, z: 1 }]),fields: {availableFields: [],rowFields: [{getter: item => item.x,label: 'X-axis'}, {getter: item => item.y,label: 'Y-axis',}],colFields: [{getter: item => item.z,label: 'Z-axis'}],},reducer: (sum, item) => sum + 1,defaultShowSettings: true,tableHeight: '400px'}}...
})
/* main.js */
import Vue from "vue"
import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'
import BootstrapVue from 'bootstrap-vue'
import App from './App.vue'Vue.use(BootstrapVue)new Vue({render: h => h(App)
}).$mount("#app")
API (API)
道具 (Props)
Prop | Type | Default | Description |
---|---|---|---|
data
|
Array
|
[]
|
Dataset to use in the pivot ; each element should be an object |
fields
|
Object (v-model)
|
[]
|
Information about pivot table. It includes available fields, row fields, column fields. You can receive the change of these information by watching this fields. Please consult the above example for usage. |
reducer
|
function
|
(sum, item) => sum + 1
|
Function applied to reduce data in the pivot table
|
tableHeight
|
Number
|
500px
|
The height of table |
default-show-settings
|
Boolean
|
true
|
Show settings at component creation |
no-data-warning-text
|
String
|
'No data to display.'
|
Text to display when data is empty
|
is-data-loading
|
Boolean
|
false
|
Display a loading content instead of the table when the value is true (see slots for customization)
|
available-fields-label-text
|
String
|
'Available fields'
|
Text for available fields drag area |
rows-label-text
|
String
|
'Rows'
|
Text for the rows drag area |
cols-label-text
|
String
|
'Columns'
|
Text for the columns drag area |
hide-settings-text
|
String
|
'Hide settings'
|
Text for the "hide settings" button |
show-settings-text
|
String
|
'Show settings'
|
Text for the "show settings" button |
Struts | 类型 | 默认 | 描述 |
---|---|---|---|
data
|
Array
|
[]
|
用于数据透视的数据集; 每个元素应该是一个对象 |
fields
|
Object (v-model)
|
[]
|
有关数据透视表的信息。 它包括可用字段,行字段,列字段。 您可以通过查看此字段来接收这些信息的更改。 请参考上面的示例以了解用法。 |
reducer
|
function
|
(sum, item) => sum + 1
|
应用于减少data 透视表中data 功能
|
tableHeight
|
Number
|
500px
|
桌子的高度 |
default-show-settings
|
Boolean
|
true
|
在创建组件时显示设置 |
no-data-warning-text
|
String
|
'No data to display.'
|
data 为空时显示的文本
|
is-data-loading
|
Boolean
|
false
|
值为true 时,显示加载内容而不是表格(请参阅插槽以进行自定义)
|
available-fields-label-text
|
String
|
'Available fields'
|
可用字段的文本拖动区域 |
rows-label-text
|
String
|
'Rows'
|
行拖动区域的文本 |
cols-label-text
|
String
|
'Columns'
|
列拖动区域的文本 |
hide-settings-text
|
String
|
'Hide settings'
|
“隐藏设置”按钮的文字 |
show-settings-text
|
String
|
'Show settings'
|
“显示设置”按钮的文字 |
栏位格式 (Field format)
Each element in the arrays fields
, colFields
or rowFields
should be an Object with this format:
数组fields
, colFields
或rowFields
中的每个元素应为具有以下格式的Object:
Prop | Type | Description |
---|---|---|
label
|
String
|
Text to display in the draggable button (Pivot only)
|
getter
|
Function
|
Function to apply on an element of data to get the field value
|
sort
|
Function
|
Optional - Function to order fields in the pivot table header ; if no value is provided, javascript-natural-sort will be applied |
showHeader
|
Boolean
|
Optional (default: true ) - Whether the header should be displayed in the pivot table
|
showFooter
|
Boolean
|
Optional (default: false ) - Whether the footer should be displayed in the pivot table
|
headerSlotName
|
String
|
Optional - Name of the slot to use to format the header in the pivot table ; if no slot name is provided, the value will be displayed as found in data |
footerSlotName
|
String
|
Optional - Same as above for the footer |
Struts | 类型 | 描述 |
---|---|---|
label
|
String
|
在可拖动按钮中显示的文本(仅用于Pivot )
|
getter
|
Function
|
应用于data 元素以获取字段值的函数
|
sort
|
Function
|
可选-用于对数据透视表标题中的字段进行排序的功能; 如果未提供任何值,则将应用javascript-natural-sort |
showHeader
|
Boolean
|
可选(默认: true )-是否应在数据透视表中显示标题
|
showFooter
|
Boolean
|
可选(默认: false )-是否在数据透视表中显示页脚
|
headerSlotName
|
String
|
可选-用于格式化数据透视表中标题的插槽名称; 如果未提供插槽名称,则该值将显示为数据中找到的值 |
footerSlotName
|
String
|
可选-与上述页脚相同 |
大型数据集 (Large datasets)
If this component is used with large datasets, consider applying Object.freeze
on your data
object to avoid useless change tracking on each data element.
如果此组件用于大型数据集,请考虑将Object.freeze
应用于data
对象,以避免对每个数据元素进行无用的更改跟踪。
See https://vuejs.org/v2/guide/instance.html#Data-and-Methods.
请参阅https://vuejs.org/v2/guide/instance.html#Data-and-Methods 。
建立 (Build)
# Install dependencies
npm install# Serve with hot reload at localhost:8080
npm run serve# Build js libraries in dist folder
npm run build:lib
未来功能 (Future features)
Change the sort order of row / column items
更改行/列项目的排序顺序
Select enable / disable of each features (reset buttons, download button, and etc.)
选择每个功能的启用/禁用(重置按钮,下载按钮等)
Demo application
演示应用
More sophiscated design updates
更多复杂的设计更新
框架/插件 (Framework/Plugin)
CSS
CSS
- Bootstrap ^4.2.1引导程序^ 4.2.1
JavaScript
JavaScript
- Vue ^2.6.10Vue ^ 2.6.10
- jQuery ^3.3.1jQuery ^ 3.3.1
- 2.0.0-rc.132.0.0-rc.13
- VueDraggable ^2.21.0VueDraggable ^ 2.21.0
翻译自: https://vuejsexamples.com/an-enhanced-pivot-table-component-for-vue-js/
vue.js组件数据绑定
vue.js组件数据绑定_Vue.js的增强的数据透视表组件相关推荐
- java 数据透视表 组件_Java创建Excel数据透视表
正版现货excel效率手册早做完不锡 22.82元 包邮 (需用券) 去购买 > Excel 数据透视表具有强大的数据处理功能,能够使表格中的数据更加直观化.使用Excel 数据透视表,能方便用 ...
- java 数据透视表 组件_Java在Excel中创建透视表方法解析
本文内容介绍通过Java程序在Excel表格中根据数据来创建透视表. 环境准备 需要使用Excel类库工具-Free Spire.XLS for Java,这里使用的是免费版,可通过官网下载Jar包并 ...
- js固定表格行列_纯前端表格控件SpreadJS V14.0发布:组件化编辑器+数据透视表
SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...
- autojs遍历当前页面所有控件_纯前端表格控件SpreadJS V14.0发布:组件化编辑器+数据透视表 - 葡萄城开发工具...
SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...
- 纯前端表格控件SpreadJS V14.0发布:组件化编辑器+数据透视表
SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...
- html 组件化 编辑器,SpreadJS V14.0发布:组件化编辑器+数据透视表
SpreadJS V14.0发布:组件化编辑器+数据透视表 2020年11月10日 15:35作者:黄页编辑:黄页 分享 SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以 ...
- html 组件化 编辑器,V14.0发布:组件化编辑器+数据透视表
SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...
- DevExpress 组件源代码,图表、报告、数据透视表
DevExpress 组件源代码,图表.报告.数据透视表 DevExpress WinForms 订阅附带一整套受 Office 启发的用户界面组件.从我们屡获殊荣的数据网格和功能区到我们的 Exce ...
- ant design vue table 高度自适应_Vue.JS 实现拼拼乐小游戏项目
笔者去年曾写过一个类似的拼拼乐小游戏,技术栈采用自己的Xuery框架和原生javascript实现的,脚手架采用gulp来实现,为了满足对vue的需求,笔者再次使用vue生态将其重构,脚手架采用比较火 ...
最新文章
- 企业分布式微服务云SpringCloud SpringBoot mybatis (二)Spring Boot属性配置文件详解...
- 《Xcode实战开发》——2.8节调试区域
- Cisco测试命令和TCP/IP连接故障处理
- 当我们谈高性能时,我们谈些什么?(送书活动)
- 人脸识别算法二:Fisherface(LDA)
- 用计算机坑人,10大坑人专业,坑你没商量!
- 目录行距怎么设置_硕士论文格式设置方法
- 二叉树的存储结构入门(java描述)
- Lazada新手开店费用有哪些、具体开店流程详解!
- ol+天地图+geoserver_天地图离线瓦片的打包与发布(GeoServer)
- 计算机组装故障排除方法,计算机组装 常见的硬件故障及排除方法
- Python:暴力破解密码
- 使用CreatePen()创建自定义画笔
- python爬取b站弹幕分析_B站直播弹幕获取 - 用python写一个B站弹幕姬吧
- 项目管理的十个经典法则
- mysql主从延迟时间是多少_MySQL主从同步个般是多久的延迟?
- 完全免费一级域名强注册地址 免费二级域名注册地址
- 目标检测算法之AAAI2019 Oral论文GHM Loss
- 【C++/嵌入式笔试面试八股】大纲介绍
- 【SAP Abap】X-DOC:SE10 - SAP 传输请求 副本传输请求的应用
热门文章
- 《庄子.齐物论》天地一指 万物一马
- 逻辑函数(AND,OR,NOT)
- 【WordPress 美化】短代码给文章添加彩色美化框+按钮
- mysql 服务被杀毒软件删掉,恢复方法
- 爬梯:JUC并发编程(二)
- 基于关联规则的推荐系统
- 【C语言】交换两个变量的值 的n种方法
- Linux那些事儿 之 戏说USB(25)设备的生命线(四)
- 荒野行动体验服服务器维护,荒野行动体验服新地图进不去怎么办 新地图体验服常见问题...
- Python爬虫-从pixabay网站爬取并下载图片