hongluan-ui
Version:
Hongluan Component Library for Vue 3
19 lines (16 loc) • 657 B
JavaScript
import { defineComponent, inject, h } from 'vue';
import { treeNodeContentProps, ROOT_TREE_INJECTION_KEY } from './virtual-tree.mjs';
var NodeContent = defineComponent({
name: "TreeNodeContent",
props: treeNodeContentProps,
setup(props) {
const tree = inject(ROOT_TREE_INJECTION_KEY);
return () => {
const node = props.node;
const { data } = node;
return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({ node, data }) : h("span", { class: "tree-node-label" }, [node == null ? void 0 : node.label]);
};
}
});
export { NodeContent as default };
//# sourceMappingURL=tree-node-content.mjs.map