feat: 拖拽布局-子布局

master
lichaojun 2 weeks ago
parent 262b8c5004
commit 2645752d85

@ -2,6 +2,7 @@
let initData = null; let initData = null;
let grid = null; let grid = null;
let currentComponent = null; let currentComponent = null;
let cellHeight = 40;
// 生成唯一id // 生成唯一id
var generateUniqueId = function () { var generateUniqueId = function () {
@ -29,19 +30,21 @@
}; };
grid = GridStack.init({ grid = GridStack.init({
// 一行高度 // 一行高度
cellHeight: 60, cellHeight,
// 间距 // 间距
margin: 5, margin: 5,
minRow: 8, minRow: Math.floor(($(window).height() - 80) / cellHeight),
acceptWidgets: true, acceptWidgets: true,
float: true, float: true,
removable: '#trash', removable: '#trash',
// subGridOpts: subOptions,
// subGridDynamic: true,
children: initData.children, children: initData.children,
}); });
GridStack.setupDragIn('#components-panel .component-item', undefined, [ GridStack.setupDragIn('#components-panel .component-item', undefined, [
{ {
w: 12, w: 12,
h: 2, h: 1,
type: 'banner', type: 'banner',
name: '我是轮播图', name: '我是轮播图',
fontSize: 14, fontSize: 14,

Loading…
Cancel
Save