From 40558e42a646876797df8b5c0ad5e94145fd8f0c Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Mon, 22 Jan 2018 21:06:51 +0800 Subject: [PATCH] add site --- examples/demo.js | 18 ++++++++++++++++++ examples/demo.vue | 30 ++++++++++++++++++------------ examples/index.less | 11 ++++++++++- examples/routes.js | 10 ++++------ 4 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 examples/demo.js diff --git a/examples/demo.js b/examples/demo.js new file mode 100644 index 000000000..146be99d1 --- /dev/null +++ b/examples/demo.js @@ -0,0 +1,18 @@ +export { default as avatar } from 'antd/avatar/demo/index.vue' +export { default as badge } from 'antd/badge/demo/index.vue' +export { default as breadcrumb } from 'antd/breadcrumb/demo/index.vue' +export { default as button } from 'antd/button/demo/index.vue' +export { default as card } from 'antd/card/demo/index.vue' +export { default as checkbox } from 'antd/checkbox/demo/index.vue' +export { default as grid } from 'antd/grid/demo/index.vue' +export { default as input } from 'antd/input/demo/index.vue' +export { default as menu } from 'antd/menu/demo/index.vue' +export { default as pagination } from 'antd/pagination/demo/index.vue' +export { default as popconfirm } from 'antd/popconfirm/demo/index.vue' +export { default as popover } from 'antd/popover/demo/index.vue' +export { default as radio } from 'antd/radio/demo/index.vue' +export { default as rate } from 'antd/rate/demo/index.vue' +export { default as tabs } from 'antd/tabs/demo/index.vue' +export { default as tag } from 'antd/tag/demo/index.vue' +export { default as tooltip } from 'antd/tooltip/demo/index.vue' + diff --git a/examples/demo.vue b/examples/demo.vue index 19ed4f550..39665deb0 100644 --- a/examples/demo.vue +++ b/examples/demo.vue @@ -1,22 +1,28 @@ - diff --git a/examples/index.less b/examples/index.less index ac6ec4a44..4536ba98e 100644 --- a/examples/index.less +++ b/examples/index.less @@ -1,3 +1,12 @@ #app { - padding: 50px; } +.site{ + display: flex; + .nav{ + width: 200px; + } + .content{ + flex: 1; + padding: 20px; + } +} \ No newline at end of file diff --git a/examples/routes.js b/examples/routes.js index 02298b234..cb3c002da 100644 --- a/examples/routes.js +++ b/examples/routes.js @@ -1,13 +1,11 @@ -import Demo from './demo' +import Demo from './demo.vue' const AsyncComp = () => { - const pathnameArr = window.location.pathname.split('/') - const com = pathnameArr[1] || 'button' // eslint-disable-line - const demo = pathnameArr[2] || 'index' return { - component: import(`../components/card/demo/${demo}.vue`), + component: import(`../components/card/demo/basic.vue`), } } export default [ { path: '/components/:name/:demo?', component: Demo }, - // { path: '/*', component: AsyncComp }, + { path: 'test/:name/:demo', component: AsyncComp }, + { path: '/*', redirect: '/components/menu' }, ]