@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`
36 lines • 1.3 kB
JavaScript
import { Fragment } from "react";
import "./index.scss";
var dsList = [[12], [6, 6], [4, 4, 4], [3, 3, 3, 3], [2, 2, 2, 2, 2, 2], [3, 9], [9, 3], [3, 6, 3], [4, 8], [8, 4]];
export function makeColumnDom(config) {
var _ref = config || {},
value = _ref.value,
_onClick = _ref.onClick;
return dsList.map(function (item) {
var tempValue = item.length > 1 ? item.join(':') : "" + item[0];
var active = tempValue === value;
return /*#__PURE__*/React.createElement("div", {
onClick: function onClick() {
_onClick === null || _onClick === void 0 ? void 0 : _onClick(tempValue);
},
className: "cn-layout-setter-item-block " + (active ? 'active' : '')
}, tempValue === '6' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
style: {
flex: 1
},
className: "cn-layout-setter-item-block-child"
}), /*#__PURE__*/React.createElement("div", {
style: {
flex: 1,
opacity: 0
},
className: "cn-layout-setter-item-block-child"
})) : item.map(function (item2) {
return /*#__PURE__*/React.createElement("div", {
style: {
flex: item2
},
className: "cn-layout-setter-item-block-child"
});
}));
});
}