1.1.0 • Published 3 years ago

sum-comp v1.1.0

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

sum-comp

用法

全局使用

在 main.js 中 先引入字体文件

import 'sum-comp/lib/sum-comp.css';
import SumComp from 'sum-comp'
Vue.use(SumComp)

// 全局组件名称
// sum-base-table
// sum-date-picker
// sum-icon
// sum-resizeable-title
// sum-resize-detecter
// sum-search-input
// sum-select
// sum-text-tooltip
局部使用
import { SumIcon } from 'sum-comp'
组件
import {
  SumBaseTable,
  SumDatePicker,
  SumIcon,
  SumResizeDetecter,
  SumResizeableTitle,
  SumSearchInput,
  SumSelect,
} from 'sum-comp'

SumBaseTable

props说明类型默认值
rowKey唯一标识string
fields见 fieldsany[]
data-source数据源any[]
height表格的 的高度, 设置高度可实现虚拟列表number
scale当前 body 的缩放比例number1
isDialogShow有弹框打开时阻止选择booleanfalse
isDragging表头拖动时阻止选择booleanfalse
cancelClear是否取消全部清除booleanfalse
selectedRowKeys选择的行的数据,保存的是行唯一标识的数组any[][]
showHeader是否展示表头booleanfalse
tableConfigb表格的头和行高的配置Object{headerHeight: 24, rowHeight: 24}
methods说明默认值/参数
selectedRows有 checkbox 时 选中行时触发所有选中行的数据
select-range点击或拖拽进行范围选择时触发[start, end], (start, end 均为 number)
cancel-select取消选择(key)
fields说明类型默认值/参数
title列标题string
name同 titlestring
align列的对齐方式(left, center, right)stringleft
field列字段名string
minWidth最小列宽度;会自动将剩余空间按比例分配number
width列宽度string (px)
scopedSlots自定义显示内容插槽 {customRender: ''}Object
slots自定义表格标题显示插槽 {title: ''}Object
其他字段 vxe-table/column/api

SumDatePicker

props说明类型默认值
selectedDate当前选择的日期string|number|object|date
format日期格式stringyyyy-MM-DD
size输入框大小,large 高度为 40px,small 为 24px,默认是 32pxstringsmall
dropdownClassName额外的弹出日历 classNamestring
methods说明回调参数
dateChange日期发生改变时触发function(date)

SumIcon | props | 说明 | 类型 | 默认值 | | -------- | ---------- | ------- | ------ | | type | icon 的类型 | string | | | disabled | 是否禁用 | boolean | false |

methods说明回调参数
on-clickicon 点击事件

SumResizeDetecter | methods | 说明 | 回调参数 | | ------- | ---------------------- | ------------------------- | | notify | 窗口大小发生改变时触发 | function({width, height}) |

SumResizeableTitle | props | 说明 | 类型 | 默认值 | | ------ | ------ | ---- | ------ | | column | 当前列 | | |

methods说明回调参数
onResizedragStop 时触发function({...column, move: number})
onDragHandler拖拽过程中触发funtion(x, y, column), x-x 轴的位移, y- 起始位置,column-当前列数据
onDropHander拖拽停止的触发
resizeCol双击表头拖拽线时触发function(column), column-当前列数据
onDragStart开始拖拽时触发function(e.clientX), clientX-起始拖拽的位置
onMouseUpToDropmouse up 时 触发

SumSearchInput | props | 说明 | 类型 | 默认值 | | ----------- | -------- | ------ | ------ | | placeholder | 提示内容 | string | |

methods说明回调参数
on-change输入框内容发生改变时触发function(text)
search回车时触发
clear-search输入框清空时 触发

SumSelect | props | 说明 | 类型 | 默认值 | | ------------ | ------------------------------------------------- | ---------------------------------- | ------------------------------ | | value | 当前选中的值 string | string|string[]|number|number[] | | | field | 选项所需修改的字段 | string | | | align | 选项对齐方式 center:居中,between:两侧 | string | between | | options | 所有选项数组 | any[] | | | optionConfig | 配置选项的 label 和值,{label: '', val: ''} | Object | {label: 'label', val: 'value'} | | defaultOpen | 是否默认打开 | boolean | false | | disabled | 是否禁用 | Boolean | false | | type | 配置选择框的类型,row-行内选择框,params-筛选条件 | string | params |

method说明回调参数
on-select选项发生改变时触发function({type, field, val}), type-row 或 params

SumTextToolTip | props | 说明 | 类型 | 默认值 | | ----- | ---- | ------ | ------ | | text | 内容 | string | |

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago