tdesign-vue
Version:
59 lines (55 loc) • 1.8 kB
JavaScript
/**
* tdesign v1.12.1
* (c) 2025 tdesign
* @license MIT
*/
import { getTNode } from '../util.js';
import { usePrefixClass } from '../../hooks/useConfig.js';
import '@babel/runtime/helpers/defineProperty';
import 'lodash-es';
import '@vue/composition-api';
import '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../_chunks/dep-b0659553.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-79359026.js';
import 'dayjs';
import '../../_common/js/global-config/t.js';
import '@babel/runtime/helpers/slicedToArray';
function useRenderOperations(state) {
var componentName = usePrefixClass("tree").value;
var renderOperations = function renderOperations(h) {
var node = state.node,
treeScope = state.treeScope;
var scopedSlots = treeScope.scopedSlots;
var treeProps = (treeScope === null || treeScope === void 0 ? void 0 : treeScope.treeProps) || {};
var operations = treeProps.operations;
var opNode = null;
if (scopedSlots !== null && scopedSlots !== void 0 && scopedSlots.operations) {
opNode = scopedSlots.operations({
node: node === null || node === void 0 ? void 0 : node.getModel()
});
} else {
opNode = getTNode(operations, {
createElement: h,
node: node
});
}
if (opNode) {
opNode = h("span", {
"class": "".concat(componentName, "__operations"),
"attrs": {
"ignore": "active,expand"
}
}, [opNode]);
}
return opNode;
};
return {
renderOperations: renderOperations
};
}
export { useRenderOperations as default };
//# sourceMappingURL=useRenderOperations.js.map