0.1.84 • Published 5 years ago

vue-tree-view-table v0.1.84

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

vue-tree-view-table

A table (with tree-grid) component for Vue.js 2.0. (Its style extends vue-table-with-tree-grid)

Installation

Use npm:

npm i vue-tree-view-table -S

Or use yarn:

yarn add vue-tree-view-table

Usage

import Vue from 'vue'
import SafeTreeview from 'vue-tree-view-table'

Vue.use(SafeTreeview)

Or

import Vue from 'vue'
import SafeTreeview from 'vue-tree-view-table'

Vue.component(SafeTreeview.name, SafeTreeview)

Table Attributes

AtributoDescripcióntipoParametroValor por defecto
datadatos a mostrarArray-[]
empty-texttexto a mostrar cuando no tiene datosString-'Aun no hay datos'
columnsconfiguracion de las columnas de la tabla(ver abajo:Columns Configs)Array-[]
show-headersi se muestra el encabezadoBoolean-true
show-indexsi se muestra el indice de datosBoolean-false
index-textnombre del indice de datosString-'index'
show-summarysi se muestra el final total de la tablaBoolean-false
sum-textsuma total de la primera filaString-'total'
summary-methodMétodo de calculo de sumaFunctiondata, column, columnIndex-
max-heightTamaño maximo de la tablaString, Number-'auto'
stripesi se muestra el color en intervalo de las filasBoolean-false
bordersi la tabla tiene bordesBoolean-false
show-row-hoversi se colorea cuando pase el cursor por encimaBoolean-true
tree-typesi es tipo árbol o noBoolean-false
children-propnombre de la propiedad que contiene los hijosString-'children'
is-foldsi se muestra plegadoBoolean-true
expand-type是否为展开行类型表格(为 True 时,需要添加名称为 '$expand' 的作用域插槽, 它可以获取到 row, rowIndex)Boolean-false
selection-type是否为多选类型表格Boolean-false
row-key行数据的 Key,用来优化 Table 的渲染Functionrow, rowIndexrowIndex
row-class-name额外的表格行的类名String, Functionrow, rowIndex-
cell-class-name额外的表格行的类名String, Functionrow, rowIndex, column, columnIndex-
row-style额外的表格行的样式Object, Functionrow, rowIndex-
cell-style额外的表格单元格的样式Object, Functionrow, rowIndex, column, columnIndex-

Columns Configs

属性说明类型默认值
label列标题名称String''
prop对应列内容的属性名String''
align对应列内容的对齐方式,可选值有 'center', 'right'String'left'
headerAlign对应列标题的对齐方式,可选值有 'center', 'right'String'left'
width列宽度String, Number'auto'
minWidth列最小宽度String, Number'80px'
type列类型,可选值有 'template'(自定义列模板)String''
template列类型为 'template'(自定义列模板) 时,对应的作用域插槽(它可以获取到 row, rowIndex, column, columnIndex)名称String''

Table Events

事件名说明参数
cell-contextmenu在某一单元格上点击鼠标右键row, rowIndex, column, columnIndex, $event
row-click单击某一行row, rowIndex, $event
row-contextmenu在某一行上点击鼠标右键row, rowIndex, $event
tree-icon-click鼠标单击树形iconrow, rowIndex, $event
expand-cell-click鼠标单击展开单元格row, rowIndex, $event

Table Methods

方法名说明参数
getCheckedProp当表格为多选类型表格时,用于获取当前所选项的属性,返回一个数组;属性默认为'index'。prop
0.1.84

5 years ago

0.1.82

5 years ago

0.1.81

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago