diff --git a/src/assets/style/color.scss b/src/assets/style/color.scss new file mode 100644 index 0000000..36a1cfb --- /dev/null +++ b/src/assets/style/color.scss @@ -0,0 +1,24 @@ +// 主色 +$color-primary: #409EFF; + +// 辅助色 +$color-info: #909399; +$color-success: #67C23A; +$color-warning: #E6A23C; +$color-danger: #F56C6C; + +// 文字 +$color-text-main: #303133; +$color-text-normal: #606266; +$color-text-sub: #909399; +$color-text-placehoder: #C0C4CC; + +// 边框 +$color-border-1: #DCDFE6; +$color-border-2: #E4E7ED; +$color-border-3: #EBEEF5; +$color-border-4: #F2F6FC; + +// 背景 +$color-bg: #F0F2F5; +$color-bg-dark: #051428; diff --git a/src/assets/style/public.scss b/src/assets/style/public.scss index 11be2dd..b283f71 100644 --- a/src/assets/style/public.scss +++ b/src/assets/style/public.scss @@ -1,3 +1,5 @@ +@import './color.scss'; + html, body { height: 100%; margin: 0; diff --git a/src/components/d2-container/com.vue b/src/components/d2-container/com.vue index 5d772b3..0ddb956 100644 --- a/src/components/d2-container/com.vue +++ b/src/components/d2-container/com.vue @@ -1,16 +1,36 @@ diff --git a/src/components/d2-source/com.vue b/src/components/d2-source/com.vue new file mode 100644 index 0000000..b754e0c --- /dev/null +++ b/src/components/d2-source/com.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 496e952..461a9df 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -3,20 +3,20 @@ height: 100%; .layout-main--side { width: 260px; - background-color: #051428; + background-color: $color-bg-dark; user-select: none; cursor: pointer; .el-menu { border-right: none; .el-menu-item { &.is-active { - background-color: #458DF8 !important; + background-color: $color-primary !important; } } } } .layout-main--body { - background-color: #F0F2F5; + background-color: $color-bg; } .overlay { height: 100%; @@ -30,13 +30,22 @@ import { menus } from '@/router' export default { name: 'layout-main', render () { - const createMenu = menu => menu.children ? createGroup(menu) : createItem(menu) - const createItem = menu => { menu.title } - const createGroup = menu => - - + function createMenu (menu) { + return menu.children ? createGroup(menu) : createItem(menu) + } + function createItem (menu) { + return + { menu.title } + + } + function createGroup (menu) { + return + { menu.children.map(child => createMenu(child)) } + } const node =
diff --git a/src/pages/demo1/1.vue b/src/pages/demo1/1.vue index 99eba8f..65e2abb 100644 --- a/src/pages/demo1/1.vue +++ b/src/pages/demo1/1.vue @@ -6,6 +6,20 @@ diff --git a/src/pages/demo2/1.vue b/src/pages/demo2/1.vue index 9a5b401..192460c 100644 --- a/src/pages/demo2/1.vue +++ b/src/pages/demo2/1.vue @@ -6,6 +6,19 @@