UNPKG

birdpaper-ui

Version:

一个通用的 vue3 UI组件库。A common vue3 UI component library.

102 lines (101 loc) 4.86 kB
"use strict"; const table_vue_vue_type_script_lang = require("./table.vue2.js"); const vue = require("vue"); const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.js"); const _hoisted_1 = { class: "bp-table", ref: "bpTable" }; const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "scrollbar" }, null, -1); const _hoisted_3 = { key: 2, class: "bp-table-body-tbody" }; const _hoisted_4 = { key: 1, class: "bp-table-td-content" }; const _hoisted_5 = { key: 0 }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_table_header = vue.resolveComponent("table-header"); const _component_table_empty = vue.resolveComponent("table-empty"); const _component_table_body = vue.resolveComponent("table-body"); const _component_table_select = vue.resolveComponent("table-select"); const _component_bp_spin = vue.resolveComponent("bp-spin"); return vue.openBlock(), vue.createBlock(_component_bp_spin, { loading: _ctx.loading }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1, [ vue.createElementVNode("div", { class: vue.normalizeClass(_ctx.innerClass) }, [ vue.createElementVNode("div", { class: "bp-table-body-area", style: vue.normalizeStyle(_ctx.bodyAreaStyle) }, [ _hoisted_2, vue.createElementVNode("table", { class: "bp-table-body", style: vue.normalizeStyle(`width:${_ctx.table_width}px`) }, [ vue.createVNode(_component_table_header, { ref: "tableHeaderRef", "header-list": _ctx.columns, onOnSelectAll: _ctx.onSelectAll }, null, 8, ["header-list", "onOnSelectAll"]), _ctx.isEmpty ? (vue.openBlock(), vue.createBlock(_component_table_empty, { key: 0, colspan: _ctx.columns.length }, null, 8, ["colspan"])) : !_ctx.isEmpty && _ctx.slots.columns ? (vue.openBlock(), vue.createBlock(_component_table_body, { key: 1, modelValue: _ctx.selectedData, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedData = $event), data: _ctx.data, selection: _ctx.selection, "row-key": _ctx.rowKey, onChange: _ctx.onSelectChange }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "columns") ]), _: 3 }, 8, ["modelValue", "data", "selection", "row-key", "onChange"])) : (vue.openBlock(), vue.createElementBlock("tbody", _hoisted_3, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data, (item, index) => { return vue.openBlock(), vue.createElementBlock("tr", { key: `bp-table-tbody-tr-${index}` }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.columns, (v, k) => { return vue.openBlock(), vue.createElementBlock("td", { key: `bp-table-tbody-td-${index}-${k}`, class: vue.normalizeClass(_ctx.tdClass(v)) }, [ ["radio", "checkbox"].includes(v.type) ? (vue.openBlock(), vue.createBlock(_component_table_select, { key: 0, modelValue: _ctx.selectedData, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.selectedData = $event), type: v.type, record: item, value: item[_ctx.rowKey], onChange: _ctx.onSelectChange }, null, 8, ["modelValue", "type", "record", "value", "onChange"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, [ !v.scope ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, vue.toDisplayString(item[v.dataIndex]), 1)) : vue.renderSlot(_ctx.$slots, v.scope.customRender, { key: 1, row: item, index, data: item[v.dataIndex] }) ])) ], 2); }), 128)) ]); }), 128)) ])) ], 4) ], 4) ], 2) ], 512) ]), _: 3 }, 8, ["loading"]); } const _table = /* @__PURE__ */ _pluginVue_exportHelper(table_vue_vue_type_script_lang, [["render", _sfc_render]]); module.exports = _table;