diff --git a/example/docs/zh-CN/components/splitPanel.md b/example/docs/zh-CN/components/splitPanel.md index 07ae38aa..dd5ee3f0 100644 --- a/example/docs/zh-CN/components/splitPanel.md +++ b/example/docs/zh-CN/components/splitPanel.md @@ -10,31 +10,129 @@ +::: + +::: title 自定义比例 +::: + + +::: demo + + + + + +::: + +::: title 垂直布局 +::: + + +::: demo + + + + + +::: + +::: title 组合用法 +::: + + +::: demo + + + + + +::: + +::: title splitPanel属性 +::: + +::: table + +| 属性 | 描述 | 类型 |可选值 | 默认值| +| ----- | ---- | ------ | ---| ---| +| vertical | 是否垂直布局 | Boolean |`true` `false`| false | +| minSize | 块拉动最小范围(按像素 `px`) | number | - | 50 | +::: + +::: title splitPanelItem属性 +::: + +::: table + +| 属性 | 描述 | 类型 |可选值 | 默认值| +| ----- | ---- | ------ | ---| ---| +| space | 默认每个站多大比例(`%`), 设置一个,
其他的都需要设置,合计为(`100` ) | number | - | 按照个数平分 | +::: + + +::: comment +::: + +::: previousNext splitPanel ::: \ No newline at end of file diff --git a/src/module/splitPanel/index.less b/src/module/splitPanel/index.less index 2b7e3eff..860a2bd6 100644 --- a/src/module/splitPanel/index.less +++ b/src/module/splitPanel/index.less @@ -1,6 +1,7 @@ .lay-split-panel{ height: 100%; display: flex; + position: relative; .lay-split-panel-item { height: 100%; flex-grow: 1; @@ -15,20 +16,48 @@ height: 100%; width: 3px; border: 1px #eeeeee solid; - background-color: #e8e8e8; + background-color: #fafafa; border-left: none; border-right: none; cursor: col-resize; + display: flex; + align-items: center; + &:before{ + content: ""; + height: 6px; + width: 100%; + border: 2px solid #dcdee2; + border-left: 0; + border-right: 0; + } } +} - //.lay-split-panel-line:before{ - // content: ''; - // position: relative; - // height: 100%; - // left: -5px; - // top: -1px; - // width: 3px; - // border: 1px #eeeeee solid; - // cursor: col-resize; - //} +.lay-split-panel-vertical{ + flex-direction: column; + position: relative; + .lay-split-panel-item-move{ + user-select: none; + pointer-events: none; + cursor: row-resize; + } + .lay-split-panel-line{ + display: flex; + justify-content: center; + width: 100%; + height: 3px; + cursor: row-resize; + border: 1px #eeeeee solid; + background-color: #fafafa; + border-top: none; + border-bottom: none; + &:before{ + content: ""; + height: 100%; + width: 6px; + border: 2px solid #dcdee2; + border-top: none; + border-bottom: none; + } + } } \ No newline at end of file diff --git a/src/module/splitPanel/index.vue b/src/module/splitPanel/index.vue index 4fc12fc4..018850c3 100644 --- a/src/module/splitPanel/index.vue +++ b/src/module/splitPanel/index.vue @@ -1,8 +1,10 @@