From 6e996cd3f0654b18141ee9c0e17ed4d86580fd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Wed, 29 Sep 2021 23:42:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=87=E6=A1=A3]=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/zh-CN/components/layout.md | 35 ++++++++++------------------ docs/docs/zh-CN/components/menu.md | 23 ++++++++++++++++++ docs/docs/zh-CN/guide/home.md | 3 +++ docs/src/layouts/Layout.vue | 31 ++++++++++++------------ docs/src/router/zh-CN.ts | 5 ++++ package.json | 2 +- src/index.ts | 11 ++++++++- src/module/menu/index.ts | 9 +++++++ src/module/menu/index.vue | 9 +++++++ src/module/menuChildItem/index.ts | 9 +++++++ src/module/menuChildItem/index.vue | 7 ++++++ src/module/menuItem/index.ts | 9 +++++++ src/module/menuItem/index.vue | 14 +++++++++++ 13 files changed, 127 insertions(+), 40 deletions(-) create mode 100644 docs/docs/zh-CN/components/menu.md create mode 100644 src/module/menu/index.ts create mode 100644 src/module/menu/index.vue create mode 100644 src/module/menuChildItem/index.ts create mode 100644 src/module/menuChildItem/index.vue create mode 100644 src/module/menuItem/index.ts create mode 100644 src/module/menuItem/index.vue diff --git a/docs/docs/zh-CN/components/layout.md b/docs/docs/zh-CN/components/layout.md index c83eb0e4..316b9b35 100644 --- a/docs/docs/zh-CN/components/layout.md +++ b/docs/docs/zh-CN/components/layout.md @@ -1,23 +1,12 @@ -::: demo - - - - - -::: \ No newline at end of file +```html + + + Layui Admin + + + + + + pearadmin.com + +``` \ No newline at end of file diff --git a/docs/docs/zh-CN/components/menu.md b/docs/docs/zh-CN/components/menu.md new file mode 100644 index 00000000..c089deec --- /dev/null +++ b/docs/docs/zh-CN/components/menu.md @@ -0,0 +1,23 @@ +::: demo + + + + + +::: diff --git a/docs/docs/zh-CN/guide/home.md b/docs/docs/zh-CN/guide/home.md index e69de29b..ae764fbc 100644 --- a/docs/docs/zh-CN/guide/home.md +++ b/docs/docs/zh-CN/guide/home.md @@ -0,0 +1,3 @@ +基于 layui 的 vue-next 组件库 + +a component library for Vue 3 base on layui-vue \ No newline at end of file diff --git a/docs/src/layouts/Layout.vue b/docs/src/layouts/Layout.vue index 8b97ab30..68e22916 100644 --- a/docs/src/layouts/Layout.vue +++ b/docs/src/layouts/Layout.vue @@ -16,24 +16,25 @@ diff --git a/docs/src/router/zh-CN.ts b/docs/src/router/zh-CN.ts index 8099e331..03748f40 100644 --- a/docs/src/router/zh-CN.ts +++ b/docs/src/router/zh-CN.ts @@ -79,6 +79,11 @@ const zhCN = [ component: () => import('../../docs/zh-CN/components/progress.md'), meta: { title: '进度' }, }, + { + path: '/zh-CN/components/menu', + component: () => import('../../docs/zh-CN/components/menu.md'), + meta: { title: '菜单' }, + }, { path: '/zh-CN/components/timeline', component: () => import('../../docs/zh-CN/components/timeline.md'), diff --git a/package.json b/package.json index ac13b4e6..e24e81b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@layui/layui-vue", - "version": "0.0.3", + "version": "0.0.4", "description": "a component library for Vue 3 base on layui-vue", "main": "lib/layui-vue.umd.js", "module": "lib/layui-vue.es.js", diff --git a/src/index.ts b/src/index.ts index 93cd1c3a..fe723abb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,6 +29,9 @@ import LayTextarea from "./module/textarea/index" import LaySwitch from "./module/switch/index" import LayCollapse from "./module/collapse/index" import LayContainer from "./module/container/index" +import LayMenu from './module/menu/index' +import LayMenuItem from './module/menuItem/index' +import LayMenuChildItem from './module/menuChildItem/index' const components: Record = { LayRadio, @@ -56,7 +59,10 @@ const components: Record = { LayTextarea, LaySwitch, LayCollapse, - LayContainer + LayContainer, + LayMenu, + LayMenuItem, + LayMenuChildItem } const install = (app: App, options?: InstallOptions): void => { @@ -96,6 +102,9 @@ export { LaySwitch, LayCollapse, LayContainer, + LayMenu, + LayMenuItem, + LayMenuChildItem, install, } diff --git a/src/module/menu/index.ts b/src/module/menu/index.ts new file mode 100644 index 00000000..7e0ee003 --- /dev/null +++ b/src/module/menu/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 || 'LayMenu', Component) +} + +export default Component as IDefineComponent diff --git a/src/module/menu/index.vue b/src/module/menu/index.vue new file mode 100644 index 00000000..b1ed4053 --- /dev/null +++ b/src/module/menu/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/module/menuChildItem/index.ts b/src/module/menuChildItem/index.ts new file mode 100644 index 00000000..718ae2b1 --- /dev/null +++ b/src/module/menuChildItem/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 || 'LayMenuChildItem', Component) +} + +export default Component as IDefineComponent diff --git a/src/module/menuChildItem/index.vue b/src/module/menuChildItem/index.vue new file mode 100644 index 00000000..ebf7efab --- /dev/null +++ b/src/module/menuChildItem/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/module/menuItem/index.ts b/src/module/menuItem/index.ts new file mode 100644 index 00000000..a90e2e38 --- /dev/null +++ b/src/module/menuItem/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 || 'LayMenuItem', Component) +} + +export default Component as IDefineComponent diff --git a/src/module/menuItem/index.vue b/src/module/menuItem/index.vue new file mode 100644 index 00000000..b186d507 --- /dev/null +++ b/src/module/menuItem/index.vue @@ -0,0 +1,14 @@ + + +