[Doc] add demo pages (#237)

* [bugfix] Checkbox border render error in weixin browser

* [bugfix] TreeSelect dependency path error

* [bugfix] Swipe should clear autoplay timer when destroyed

* [bugfix] Optimize component dependency analyze when build style entry

* merge

* update yarn.lock

* update README.md

* update README.md

* update README.md

* update README.md

* update README.md

* [Doc] add more badges in README.md

* update README.md

* [bugfix] Address & Contact list style

* fix: contact test cases

* [bugfix] popup style missing when build style entry

* [bugfix] Search: onSearch event arguments missing

* [Doc] add demo pages

* update zan-doc@0.3.7

* fix: build entry error
This commit is contained in:
neverland
2017-10-24 02:27:04 -05:00
committed by GitHub
parent 7e5dae3221
commit 0da517e004
14 changed files with 163 additions and 39 deletions

View File

@@ -3,19 +3,16 @@ import { getLang } from './utils/lang';
import DemoList from './components/demo-list';
import componentDocs from '../examples-dist/entry-docs';
import componentDemos from '../examples-dist/entry-demos';
import Demo from './components/demo';
import './utils/iframe-router';
const registerRoute = (isExample) => {
const route = [{
path: '/',
redirect: to => {
return `/${getLang()}/`;
}
redirect: to => `/${getLang()}/`
}, {
path: '*',
redirect: to => {
return `/${getLang()}/`;
}
redirect: to => `/${getLang()}/`
}];
Object.keys(docConfig).forEach((lang, index) => {
@@ -53,9 +50,18 @@ const registerRoute = (isExample) => {
const { path } = page;
if (path) {
const name = lang + '/' + path.replace('/', '');
let component;
if (path === '/demo') {
component = Demo;
} else {
component = isExample ? componentDemos[name] : componentDocs[name];
}
route.push({
name,
component,
path: `/${lang}/component${path}`,
component: isExample ? componentDemos[name] : componentDocs[name],
meta: { lang }
});
}