UNPKG

@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`

29 lines 1.12 kB
import { ROW, COL } from "../../../common/util/const"; export var 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 === ROW || parentCN === COL) && parentChildrenLength && parentChildrenLength > 1) { if (parentCN === 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; };