element-plus
Version:
A Component Library for Vue 3
77 lines (74 loc) • 2.84 kB
JavaScript
import { defineComponent, inject, resolveComponent, openBlock, createElementBlock, Fragment, createElementVNode, renderList, createBlock, createVNode } from 'vue';
import DescriptionsCell from './descriptions-cell.mjs';
import { elDescriptionsKey } from './token.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
const _sfc_main = defineComponent({
name: "ElDescriptionsRow",
components: {
[DescriptionsCell.name]: DescriptionsCell
},
props: {
row: {
type: Array
}
},
setup() {
const descriptions = inject(elDescriptionsKey, {});
return {
descriptions
};
}
});
const _hoisted_1 = { key: 1 };
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_descriptions_cell = resolveComponent("el-descriptions-cell");
return _ctx.descriptions.direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, index) => {
return openBlock(), createBlock(_component_el_descriptions_cell, {
key: `tr1-${index}`,
cell,
tag: "th",
type: "label"
}, null, 8, ["cell"]);
}), 128))
]),
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, index) => {
return openBlock(), createBlock(_component_el_descriptions_cell, {
key: `tr2-${index}`,
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"]);
}), 128))
])
], 64)) : (openBlock(), createElementBlock("tr", _hoisted_1, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, index) => {
return openBlock(), createElementBlock(Fragment, {
key: `tr3-${index}`
}, [
_ctx.descriptions.border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createVNode(_component_el_descriptions_cell, {
cell,
tag: "td",
type: "label"
}, null, 8, ["cell"]),
createVNode(_component_el_descriptions_cell, {
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"])
], 64)) : (openBlock(), createBlock(_component_el_descriptions_cell, {
key: 1,
cell,
tag: "td",
type: "both"
}, null, 8, ["cell"]))
], 64);
}), 128))
]));
}
var DescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/descriptions-row.vue"]]);
export { DescriptionsRow as default };
//# sourceMappingURL=descriptions-row.mjs.map