diff --git a/example/docs/zh-CN/components/splitPanel.md b/example/docs/zh-CN/components/splitPanel.md new file mode 100644 index 00000000..07ae38aa --- /dev/null +++ b/example/docs/zh-CN/components/splitPanel.md @@ -0,0 +1,40 @@ +::: anchor +::: + +::: title 基础使用 +::: + + +::: demo + + + + + 1 + 2 + + + + + + +::: \ No newline at end of file diff --git a/example/src/router/zh-CN.ts b/example/src/router/zh-CN.ts index 8f5347f9..727c880c 100644 --- a/example/src/router/zh-CN.ts +++ b/example/src/router/zh-CN.ts @@ -76,6 +76,12 @@ const zhCN = [ component: Component, meta: { title: "组件" }, children: [ + { + path: "/zh-CN/components/splitPanel", + component: () => + import("../../docs/zh-CN/components/splitPanel.md"), + meta: { title: "分割面板" }, + }, { path: "/zh-CN/components/skeleton", component: () => import("../../docs/zh-CN/components/skeleton.md"), diff --git a/src/index.ts b/src/index.ts index 145c9f2d..016511ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -70,9 +70,13 @@ import LaySkeleton from "./module/skeleton/index"; import LaySkeletonItem from "./module/skeletonItem/index"; import LayStep from "./module/step/index"; import LayStepItem from "./module/stepItem/index"; -import LaySubMenu from "./module/subMenu/index" +import LaySubMenu from "./module/subMenu/index"; +import LaySplitPanel from "./module/splitPanel/index"; +import LaySplitPanelItem from "./module/splitPanelItem/index"; const components: Record = { + LaySplitPanel, + LaySplitPanelItem, LayRadio, LayButton, LayIcon, @@ -137,7 +141,7 @@ const components: Record = { LayCountUp, LayStep, LayStepItem, - LaySubMenu + LaySubMenu, }; const install = (app: App, options?: InstallOptions): void => { @@ -150,6 +154,8 @@ const install = (app: App, options?: InstallOptions): void => { }; export { + LaySplitPanel, + LaySplitPanelItem, LayRadio, LayButton, LayIcon, @@ -214,7 +220,7 @@ export { LayCountUp, LayStep, LayStepItem, - LaySubMenu + LaySubMenu, }; export { layer }; diff --git a/src/module/splitPanel/index.less b/src/module/splitPanel/index.less new file mode 100644 index 00000000..2b7e3eff --- /dev/null +++ b/src/module/splitPanel/index.less @@ -0,0 +1,34 @@ +.lay-split-panel{ + height: 100%; + display: flex; + .lay-split-panel-item { + height: 100%; + flex-grow: 1; + border: 1px #eeeeee solid; + } + .lay-split-panel-item-move{ + user-select: none; + pointer-events: none; + cursor: col-resize; + } + .lay-split-panel-line{ + height: 100%; + width: 3px; + border: 1px #eeeeee solid; + background-color: #e8e8e8; + border-left: none; + border-right: none; + cursor: col-resize; + } + + //.lay-split-panel-line:before{ + // content: ''; + // position: relative; + // height: 100%; + // left: -5px; + // top: -1px; + // width: 3px; + // border: 1px #eeeeee solid; + // cursor: col-resize; + //} +} \ No newline at end of file diff --git a/src/module/splitPanel/index.ts b/src/module/splitPanel/index.ts new file mode 100644 index 00000000..33994b0a --- /dev/null +++ b/src/module/splitPanel/index.ts @@ -0,0 +1,9 @@ +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; + +Component.install = (app: App) => { + app.component(Component.name || "laySplitPanel", Component); +}; + +export default Component as IDefineComponent; diff --git a/src/module/splitPanel/index.vue b/src/module/splitPanel/index.vue new file mode 100644 index 00000000..4fc12fc4 --- /dev/null +++ b/src/module/splitPanel/index.vue @@ -0,0 +1,96 @@ + + + + + + + diff --git a/src/module/splitPanelItem/index.ts b/src/module/splitPanelItem/index.ts new file mode 100644 index 00000000..2f765d25 --- /dev/null +++ b/src/module/splitPanelItem/index.ts @@ -0,0 +1,9 @@ +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; + +Component.install = (app: App) => { + app.component(Component.name || "laySplitPanelItem", Component); +}; + +export default Component as IDefineComponent; diff --git a/src/module/splitPanelItem/index.vue b/src/module/splitPanelItem/index.vue new file mode 100644 index 00000000..25f0d436 --- /dev/null +++ b/src/module/splitPanelItem/index.vue @@ -0,0 +1,98 @@ + + + + {{ parents.elementX }}{{ pressed }} + + + +