@cainiaofe/cn-ui-layout
Version:
- 安装 cone-cli | [Cone-CLI 使用指引](https://alidocs.dingtalk.com/i/nodes/xdqZp24KneBJzvGM6XezJvyb7RA0Nr1E) - `tnpm i -g @alife/cone-cli@latest` - 安装依赖包 - `cone install` - 启动研发 - `cone start`
33 lines (32 loc) • 1.24 kB
JavaScript
;
exports.__esModule = true;
exports.getResizingHandlers = void 0;
var _const = require("../../../common/util/const");
var getResizingHandlers = exports.getResizingHandlers = function getResizingHandlers(node) {
var _parentNode$children;
var directionList = [];
var parentNode = node.parent;
var parentChildrenLength = parentNode === null || parentNode === void 0 ? void 0 : (_parentNode$children = parentNode.children) === null || _parentNode$children === void 0 ? void 0 : _parentNode$children.size;
var parentCN = parentNode === null || parentNode === void 0 ? void 0 : parentNode.componentName;
// debugger;
if ((parentCN === _const.ROW || parentCN === _const.COL) && parentChildrenLength && parentChildrenLength > 1) {
if (parentCN === _const.COL) {
// 列容器,只能上下拖动
if (node.index > 0) {
directionList.push('n');
}
if (node.index < parentChildrenLength - 1) {
directionList.push('s');
}
} else {
// 行容器,只能左右拖动
if (node.index > 0) {
directionList.push('w');
}
if (node.index < parentChildrenLength - 1) {
directionList.push('e');
}
}
}
return directionList;
};