From f516b26eddfbb0ec96cf5929de945280125dffc9 Mon Sep 17 00:00:00 2001 From: Justineo Date: Thu, 21 Apr 2022 23:23:30 +0800 Subject: [PATCH] feat: refine sidenav and layout demo, update veui --- components/OneDemo.vue | 7 +- components/OneLive.vue | 10 +- components/OneRepl.vue | 4 +- one/docs/components/layout.md | 8 +- one/docs/components/{menu.md => sidenav.md} | 17 +- one/docs/demo/form/withhold.vue | 2 +- one/docs/demo/grid/default.vue | 4 + one/docs/demo/grid/fixed.vue | 1 + one/docs/demo/layout/basic.vue | 29 +- one/docs/demo/layout/global-footer.vue | 29 +- one/docs/demo/layout/global-sidebar.vue | 29 +- one/docs/demo/layout/sticky.vue | 50 +- .../demo/{menu => sidenav}/collaspible.vue | 52 +- one/docs/demo/{menu => sidenav}/normal.vue | 10 +- one/docs/demo/{menu => sidenav}/slot.vue | 24 +- one/docs/nav.json | 8 +- package-lock.json | 1459 ++++++++++++++++- package.json | 10 +- 18 files changed, 1596 insertions(+), 157 deletions(-) rename one/docs/components/{menu.md => sidenav.md} (89%) rename one/docs/demo/{menu => sidenav}/collaspible.vue (64%) rename one/docs/demo/{menu => sidenav}/normal.vue (91%) rename one/docs/demo/{menu => sidenav}/slot.vue (85%) diff --git a/components/OneDemo.vue b/components/OneDemo.vue index 12eb42a..e175471 100644 --- a/components/OneDemo.vue +++ b/components/OneDemo.vue @@ -7,7 +7,7 @@ @@ -86,6 +86,7 @@ }" :code="code" :expanded="editorExpanded" + :browser="!!browser" @close="handleEditorClose" @toggle="handleEditorToggle" /> @@ -221,6 +222,10 @@ Icon.register({ border-top-right-radius 4px padding 30px + & >>> .style-module_body__14MV- + transform translate(0, 0) + padding 0 + .desc border 1px solid #eee padding 18px 20px diff --git a/components/OneLive.vue b/components/OneLive.vue index 1a1218e..7aa8c14 100644 --- a/components/OneLive.vue +++ b/components/OneLive.vue @@ -64,6 +64,9 @@ >> .live-preview overflow auto +.live-preview-browser + transform translate(0, 0) + padding 0 !important + .editor-toolbar position absolute top 12px diff --git a/components/OneRepl.vue b/components/OneRepl.vue index 2fc50f3..4882a71 100644 --- a/components/OneRepl.vue +++ b/components/OneRepl.vue @@ -21,6 +21,7 @@ @@ -60,7 +61,8 @@ export default { type: String, default: '' }, - expanded: Boolean + expanded: Boolean, + browser: Boolean }, methods: { handleClose () { diff --git a/one/docs/components/layout.md b/one/docs/components/layout.md index 1d5629d..c7ac279 100644 --- a/one/docs/components/layout.md +++ b/one/docs/components/layout.md @@ -10,15 +10,15 @@ `Layout` 组件支持多种典型布局。 -[[ demo src="/demo/layout/basic.vue" ]] +[[ demo src="/demo/layout/basic.vue" browser="/demos/layout/basic.vue" ]] ### 通顶侧边栏 -[[ demo src="/demo/layout/global-sidebar.vue" ]] +[[ demo src="/demo/layout/global-sidebar.vue" browser="/demos/layout/global-sidebar.vue" ]] ### 通栏底部 -[[ demo src="/demo/layout/global-footer.vue" ]] +[[ demo src="/demo/layout/global-footer.vue" browser="/demos/layout/global-footer.vue" ]] ### 吸顶/吸底布局 @@ -32,7 +32,7 @@ 当吸底的布局底部和吸顶侧边栏一起使用需要在布局底部的父组件 `Layout` 上设置 `--dls-layout-footer-height` 来指定布局底部的高度。 ::: -[[ demo src="/demo/layout/sticky.vue" ]] +[[ demo src="/demo/layout/sticky.vue" browser="/demos/layout/sticky.vue" ]] ## API diff --git a/one/docs/components/menu.md b/one/docs/components/sidenav.md similarity index 89% rename from one/docs/components/menu.md rename to one/docs/components/sidenav.md index 69932be..8931c9b 100644 --- a/one/docs/components/menu.md +++ b/one/docs/components/sidenav.md @@ -1,4 +1,4 @@ -# Menu 边栏菜单 +# Sidenav 边栏菜单 ## 示例 @@ -6,17 +6,17 @@ 结合 Vue Router 使用边栏菜单。 -[[ demo src="/demo/menu/normal.vue" ]] +[[ demo src="/demo/sidenav/normal.vue" ]] ### 可折叠 -使用 [`collapsible`](#props-collapsible) 属性控制菜单是否可以折叠。 +配合 `Sidebar` 的 [`collapsible`](./sidebar#props-collapsible) 属性可以控制菜单的展开/收起。 -[[ demo src="/demo/menu/collaspible.vue" ]] +[[ demo src="/demo/sidenav/collaspible.vue" browser="/demo/sidenav/collaspible.vue" ]] ### 自定义插槽 -[[ demo src="/demo/menu/slot.vue" ]] +[[ demo src="/demo/sidenav/slot.vue" ]] ## API @@ -28,7 +28,6 @@ | ``items`` | `Array=` | `[]` | [^items] | | ``active`` | `string` | - | [^active] | | ``matches`` | `function(Object, string): boolean` | - | [^matches] | -| ``collapsible`` | `boolean` | `false` | 整个导航菜单是否可折叠。 | | ``collapsed`` | `boolean` | `false` | [^collapsed] | | ``expanded`` | `Array=` | `[]` | [^expanded] | @@ -139,9 +138,3 @@ | -- | -- | | ``activate`` | 用户点击有 `to` 的节点触发,参数是激活节点的整个 `item` 数据。 | | ``click`` | 用户点击节点时触发,参数是激活节点整个 `item` 数据。 | - -### 图标 -| 名称 | 描述 | -| -- | -- | -| ``expand`` | 展开。 | -| ``collapse`` | 折叠。 | diff --git a/one/docs/demo/form/withhold.vue b/one/docs/demo/form/withhold.vue index 624dac1..4e89d27 100644 --- a/one/docs/demo/form/withhold.vue +++ b/one/docs/demo/form/withhold.vue @@ -10,10 +10,10 @@ > diff --git a/one/docs/demo/grid/default.vue b/one/docs/demo/grid/default.vue index 6cc624b..fa90b74 100644 --- a/one/docs/demo/grid/default.vue +++ b/one/docs/demo/grid/default.vue @@ -64,6 +64,10 @@ export default { diff --git a/one/docs/demo/menu/normal.vue b/one/docs/demo/sidenav/normal.vue similarity index 91% rename from one/docs/demo/menu/normal.vue rename to one/docs/demo/sidenav/normal.vue index ead4c87..07a244a 100644 --- a/one/docs/demo/menu/normal.vue +++ b/one/docs/demo/sidenav/normal.vue @@ -1,18 +1,16 @@