mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[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:
@@ -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 }
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user