0.1.65 • Published 2 years ago

ys-vue v0.1.65

Weekly downloads
236
License
-
Repository
-
Last release
2 years ago

TABLE文档

variables

组件配置属性,详情见下面Option属性

参数说明类型可选值默认值
data显示数据Array--
option组件配置属性,详情见下面Option属性Object--

Option Attributes

参数说明类型可选值默认值
column显示列表组,详情见下面Column属性Array--
propEmptyDefault列表没有值时,默认显示的值String--
isLoading是否正在加载中Booleantrue/falsefalse
isMenu是否显示操作列Booleantrue/falsetrue
isPagination是否显示分页Booleantrue/falsefalse
paginationCurrent当前页码Number--
paginationSize每一页加载多少条数据Number--
paginationTotal总页数Number--
paginationPageSizes分页信息Array-10, 20, 30, 40
menuLabel操作列的标题String-操作
menuWidth操作列的宽度String-操作
menuAlign操作列的对齐方式Stringleft/center/rightright
menuFixed操作列是否固定在左侧或者右侧,true 表示固定在左侧String/Booleanleft/true/right-
isMenuEdit是否显示编辑按钮Booleantrue/falsetrue
menuEditTitle显示编辑按钮的文本String-编辑
isMenuDelete是否显示删除按钮Booleantrue/falsetrue
menuDeleteTitle显示删除按钮的文本String-删除
menuEditOption编辑按钮类型时的按钮属性,详情查看一下的menuEditOption/menuDeleteOption AttributesObject--
menuDeleteOption删除按钮类型时的按钮属性,详情查看一下的menuEditOption/menuDeleteOption AttributesObject--
emptyText数据为空时文案,也可以设置slot->emptyString-暂无数据
isIndex是否显示序列号Booleantrue/falsefalse
indexLabel序列号头部标题String-#
indexMethod序列号自定义索引,例如:indexMethod(index) {return index * 2;}number, Function(index)--
indexWidth序列号列的宽度String-50
indexFixed序列号列的宽度String/Booleanleft/true/right-
indexAlign序列号列的宽度Stringleft/center/right-
isExpand是否可展开模式Booleantrue/falsefalse
expandLabel展开模式头部标题String--
expandWidth展开模式列的宽度String-50
expandFixed展开模式列是否固定在左侧或者右侧,true 表示固定在左侧String/Booleanleft/true/right-
expandAlign展开模式的对齐方式Stringleft/center/right-
slotExpand展开模式的插槽,返回的数据:data当前列数据,index列索引---
isSelection是否可多选模式Booleantrue/falsefalse
selectionLabel多选模式头部标题String--
selectionWidth多选模式列的宽度String-50
selectionFixed多选模式列是否固定在左侧或者右侧,true 表示固定在左侧String/Booleanleft/true/right-
selectionAlign多选模式的对齐方式Stringleft/center/right-
heightTable 的高度,默认为自动高度。String/Number--
maxHeightTable 的最大高度,例如:50、150pxString/Number--
border是否带有纵向边框Booleantrue/falsefalse
styleTable 的尺寸Stringmedium / small / mini-
showHeader是否显示表头Booleantrue/falsefalse
highlightCurrentRow是否要高亮当前行Booleantrue/falsefalse
currentRowKey当前行的 keyString,Number--

Column Attributes

参数说明类型可选值默认值
slotHeader当前列插槽头部自定义插槽String--
slotName当前列插槽,返回的数据:data当前列数据,index列索引String--
label标题String--
colType对应列的类型,同element-ui typeStringselection/index/expand-
indexMethod只有在colType =index有效,序列号自定义索引,例如:indexMethod(index) {return index * 2;}number, Function(index)--
columnKeycolumn 的 key,如果需要使用 filter-change 事件,则需要此属性标识是哪个 column 的筛选条件String--
width列的宽度String--
minWidth列的最小宽度String--
fixed操作列是否固定在左侧或者右侧,true 表示固定在左侧String/Booleanleft/true/right-
renderHeader列标题 Label 区域渲染使用的 FunctionFunction--
sortable对应列是否可以排序Booleantrue/falsefalse
sortMethod对数据进行排序的时候使用的方法,仅当 sortable 设置为 true 的时候有效,需返回一个数字,和 Array.sort 表现一致Function--
sortBy指定数据按照哪个属性进行排序String/Array/Function(row, index)--
sortOrders数据在排序时所使用排序策略的轮转顺序,参考element-ui sort-orders---
resizable对应列是否可以通过拖动改变宽度,参考element-ui resizable---
formatter用来格式化内容---
showOverflowTooltip当内容过长被隐藏时显示 tooltipBooleantrue/falsefalse
align列的对齐方式Stringleft/center/right-
classNameclass 名称String--

Events

事件名说明
handleEdit点击编辑按钮,返回值,scope
handleDelete点击删除按钮,返回值,scope
paginationChance在isPagination=true时,页码改变回调事件
selectionChange当选择项发生变化时会触发该事件
$emit当用户手动勾选数据行的 Checkbox 时触发的事件
selectAll当用户手动勾选全选 Checkbox 时触发的事件
sortChange当表格的排序条件发生变化的时候会触发该事件
rowClick当某一行被点击时会触发该事件
rowDblclick当某个单元格被双击击时会触发该事件
cellMouseEnter当单元格 hover 进入时会触发该事件
cellMouseLeave当单元格 hover 退出时会触发该事件
cellClick当某个单元格被点击时会触发该事件
cellDblclick当某个单元格被双击击时会触发该事件
currentRowChange当表格的当前行发生变化的时候会触发该事件,如果要高亮当前行,请打开表格的 highlight-current-row 属性
expandChange当用户对某一行展开或者关闭的时候会触发该事件(展开行时,回调的第二个参数为 expandedRows;树形表格时第二参数为 expanded)
rowContextmenu当某一行被鼠标右键点击时会触发该事件
headerClick当某一列的表头被点击时会触发该事件
headerDragend当拖动表头改变了列的宽度的时候会触发该事件

Methods

方法名说明说明
clearSelection用于多选表格,清空用户的选择-
toggleAllSelection用于多选表格,切换所有行的选中状态-
clearSort用于清空排序条件,数据会恢复成未排序的状态-
doLayout对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法-
toggleRowSelection用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中)row, selected
toggleRowExpansion用于可展开表格与树形表格,切换某一行的展开状态,如果使用了第二个参数,则是设置这一行展开与否(expanded 为 true 则展开)row, selected
setCurrentRow用于单选表格,设定某一行为选中行,如果调用时不加参数,则会取消目前高亮行的选中状态。row
clearFilter不传入参数时用于清空所有过滤条件,数据会恢复成未过滤的状态,也可传入由columnKey组成的数组以清除指定列的过滤条件columnKey
sort不传入参数时用于清空所有过滤条件,数据会恢复成未过滤的状态,也可传入由columnKey组成的数组以清除指定列的过滤条件prop: string, order: string

Slot 插槽

事件名说明
menu右边操作栏插槽
menuHeader右边操作栏头部自定义
slotPagination分页左边的插槽,只有在isPagination = true时有效

编辑列按钮类型时的按钮属性

参数说明类型可选值默认值
size按钮尺寸Stringmedium / small / minimini
type按钮类型,删除按钮默认为dangerStringprimary / success / warning / danger / info / text-
plain是否朴素按钮Booleantrue/falsefalse
round是否圆角按钮Booleantrue/falsefalse
circle是否圆形按钮Booleantrue/falsefalse
loading是否加载中状态Booleantrue/falsefalse
icon图标类名String--
style按钮styleString--
0.1.63

2 years ago

0.1.64

2 years ago

0.1.65

2 years ago

0.1.62

3 years ago

0.1.60

4 years ago

0.1.61

4 years ago

0.1.58

4 years ago

0.1.59

4 years ago

0.1.57

4 years ago

0.1.56

4 years ago

0.1.55

4 years ago

0.1.54

4 years ago

0.1.53

4 years ago

0.1.52

4 years ago

0.1.51

4 years ago

0.1.50

4 years ago

0.1.49

4 years ago

0.1.48

4 years ago

0.1.46

4 years ago

0.1.45

4 years ago

0.1.44

4 years ago

0.1.43

4 years ago

0.1.42

4 years ago

0.1.41

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.37

4 years ago

0.1.36

4 years ago

0.1.35

4 years ago

0.1.34

4 years ago

0.1.33

4 years ago

0.1.32

4 years ago

0.1.31

5 years ago

0.1.30

5 years ago

0.1.29

5 years ago

0.1.28

5 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.10

5 years ago

0.1.9

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