UNPKG

vxe-table

Version:

A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.

55 lines (54 loc) • 1.07 kB
import XEUtils from "xe-utils"; function getOnName(type) { return "on" + type.substring(0, 1).toLocaleUpperCase() + type.substring(1); } function getModelEvent(renderOpts) { switch (renderOpts.name) { case "input": case "textarea": return "input"; case "select": return "change"; } return "update:modelValue"; } function getChangeEvent(renderOpts) { switch (renderOpts.name) { case "input": case "textarea": case "VxeInput": case "VxeNumberInput": case "VxeTextarea": case "$input": case "$textarea": return "input"; } return "change"; } function hasInputType(renderOpts) { switch (renderOpts.name) { case "VxeInput": case "VxeNumberInput": case "VxeTextarea": case "$input": case "$textarea": return true; } return false; } function getSlotVNs(vns) { if (vns === null || vns === void 0) { return []; } if (XEUtils.isArray(vns)) { return vns; } return [vns]; } export { getChangeEvent, getModelEvent, getOnName, getSlotVNs, hasInputType };