From a2eb028782a1da2da589999a176c89bb72d70b85 Mon Sep 17 00:00:00 2001 From: zhigang.li Date: Mon, 18 Dec 2017 18:25:16 +0800 Subject: [PATCH] add layout component with header, content, sider and footer --- examples/app.vue | 3 ++- examples/main.js | 4 ++++ examples/routers/layout.vue | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/content/index.js | 3 +++ src/components/footer/index.js | 3 +++ src/components/header/index.js | 3 +++ src/components/layout/content.vue | 28 ++++++++++++++++++++++++++++ src/components/layout/footer.vue | 28 ++++++++++++++++++++++++++++ src/components/layout/header.vue | 28 ++++++++++++++++++++++++++++ src/components/layout/index.js | 12 ++++++++++++ src/components/layout/layout.vue | 43 +++++++++++++++++++++++++++++++++++++++++++ src/components/layout/sider.vue | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/sider/index.js | 3 +++ src/index.js | 15 ++++++++++++++- src/styles/components/index.less | 1 + src/styles/components/layout.less | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/styles/custom.less | 15 +++++++++++++-- 17 files changed, 509 insertions(+), 4 deletions(-) create mode 100644 examples/routers/layout.vue create mode 100644 src/components/content/index.js create mode 100644 src/components/footer/index.js create mode 100644 src/components/header/index.js create mode 100644 src/components/layout/content.vue create mode 100644 src/components/layout/footer.vue create mode 100644 src/components/layout/header.vue create mode 100644 src/components/layout/index.js create mode 100644 src/components/layout/layout.vue create mode 100644 src/components/layout/sider.vue create mode 100644 src/components/sider/index.js create mode 100644 src/styles/components/layout.less diff --git a/examples/app.vue b/examples/app.vue index 9c20245..b93032a 100644 --- a/examples/app.vue +++ b/examples/app.vue @@ -6,13 +6,14 @@ nav { margin-bottom: 40px; } ul { display: flex; flex-wrap: wrap; } li { display: inline-block; } li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; } -.container{ padding: 10px 40px; } +.container{ padding: 10px 40px 0; } .v-link-active { color: #bbb; }