docs: update site

pull/77/merge
tjz 2018-07-13 21:55:29 +08:00
parent e7a05154a9
commit 0778cc098e
11 changed files with 812 additions and 94 deletions

View File

@ -50,24 +50,26 @@ function dist (done) {
function copyHtml () {
const rl = readline.createInterface({
input: fs.createReadStream(path.join(cwd, 'site/demo.js')),
input: fs.createReadStream(path.join(cwd, 'site/demoRoutes.js')),
})
rl.on('line', (line) => {
const name = line.split('antd/')[1].split('/')[0]
console.log('create path:', name)
const toPaths = [
`site-dist/components/${name}`,
`site-dist/components/${name}-cn`,
`site-dist/iframe/${name}`,
`site-dist/iframe/${name}-cn`,
]
toPaths.forEach(toPath => {
rimraf.sync(path.join(cwd, toPath))
mkdirp(path.join(cwd, toPath), function () {
fs.writeFileSync(path.join(cwd, `${toPath}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
if (line.indexOf('path:') > -1) {
const name = line.split("'")[1].split("'")[0]
console.log('create path:', name)
const toPaths = [
`site-dist/components/${name}`,
// `site-dist/components/${name}-cn`,
`site-dist/iframe/${name}`,
// `site-dist/iframe/${name}-cn`,
]
toPaths.forEach(toPath => {
rimraf.sync(path.join(cwd, toPath))
mkdirp(path.join(cwd, toPath), function () {
fs.writeFileSync(path.join(cwd, `${toPath}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
})
})
})
}
})
const source = [
'docs/vue/*.md',

View File

@ -8,10 +8,12 @@
import { isZhCN } from '../util'
export default {
name: 'api',
inject: {
demoContext: { default: {}},
},
data () {
const { name } = this.$route.params
return {
isZhCN: isZhCN(name),
isZhCN: isZhCN(this.demoContext.name),
}
},
}

View File

@ -48,9 +48,10 @@ export default {
inject: {
_store: { default: {}},
iframeDemo: { default: {}},
demoContext: { default: {}},
},
data () {
const { name = '' } = this.$route.params
const { name = '' } = this.demoContext
const { html, script, style, us, cn, sourceCode } = this.jsfiddle
// let sourceCode = `<template>${html}</template>\n`
// sourceCode = script ? sourceCode + '\<script>' + script + '<\/script>' : sourceCode

View File

@ -1,22 +1,28 @@
<script>
import * as AllDemo from '../demo'
// import * as AllDemo from '../demo'
export default {
props: {
name: String,
hash: String,
},
provide () {
return {
demoContext: this,
}
},
render () {
const name = this.name
const titleMap = {}
for (const [title] of Object.entries(AllDemo)) {
const key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`
titleMap[key] = title
}
const Demo = AllDemo[titleMap[name.replace(/-cn\/?$/, '')]]
const hash = this.$route.hash.replace('#', '')
// const name = this.name
// const titleMap = {}
// for (const [title] of Object.entries(AllDemo)) {
// const key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`
// titleMap[key] = title
// }
// const Demo = AllDemo[titleMap[name.replace(/-cn\/?$/, '')]]
// const hash = this.$route.hash.replace('#', '')
return (
<div id='iframe-page'>
<Demo iframeName={hash} />
<router-view></router-view>
</div>
)
},

View File

@ -1,5 +1,6 @@
<script>
import * as AllDemo from '../demo'
import Vue from 'vue'
import AllDemo from '../demo'
import Header from './header'
import zhCN from 'antd/locale-provider/zh_CN'
import enUS from 'antd/locale-provider/default'
@ -19,6 +20,8 @@ const docsList = [
export default {
props: {
name: String,
showDemo: Boolean,
showApi: Boolean,
},
data () {
this.store = create({
@ -29,6 +32,11 @@ export default {
currentSubMenu: [],
}
},
provide () {
return {
demoContext: this,
}
},
beforeDestroy () {
if (this.unsubscribe) {
this.unsubscribe()
@ -117,6 +125,7 @@ export default {
document.title = titleStr
},
},
render () {
const name = this.name
const isCN = isZhCN(name)
@ -136,11 +145,18 @@ export default {
const type = d.type || 'Other'
const key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`
titleMap[key] = title
AllDemo[title].key = key
menuConfig[type] = menuConfig[type] || []
menuConfig[type].push(d)
}
const reName = name.replace(/-cn\/?$/, '')
const Demo = AllDemo[titleMap[reName]]
// const Demo = new Vue({
// template: '<demo-component/>',
// components: {
// 'demo-component': () => import(`../../components/${AllDemo[titleMap[reName]].key}/demo/index.vue`),
// },
// })
// AllDemo[titleMap[reName]]
const MenuGroup = []
for (const [type, menus] of Object.entries(menuConfig)) {
const MenuItems = []
@ -167,7 +183,7 @@ export default {
if (!isCN) {
locale = enUS
}
this.resetDocumentTitle(Demo, reName, isCN)
this.resetDocumentTitle(AllDemo[titleMap[reName]], reName, isCN)
return (
<div class='page-wrapper'>
<Header searchData={searchData} name={name}/>
@ -192,17 +208,18 @@ export default {
<div class='toc-affix' style='width: 110px;'>
{this.getSubMenu(isCN)}
</div>
{Demo ? <Provider store={this.store}>
<Demo key={isCN ? 'cn' : 'en'}/>
</Provider> : ''}
<div class='markdown api-container' ref='doc'>
{this.showDemo ? <Provider store={this.store} key={isCN ? 'cn' : 'en'}>
<router-view></router-view>
</div>
</Provider> : ''}
{this.showApi ? <div class='markdown api-container' ref='doc'>
<router-view></router-view>
</div> : ''}
</div>
</a-col>
</a-row>
</div>
</a-locale-provider>
{ name.indexOf('back-top') === -1 ? <a-back-top /> : null }
</div>
)
},

View File

@ -32,14 +32,16 @@ export default {
cn: String,
us: String,
},
inject: {
demoContext: { default: {}},
},
data () {
const { name } = this.$route.params
let text = ''
const { cn, us } = this
if (this.$slots.default && this.$slots.default[0] && this.$slots.default[0].text) {
text = this.$slots.default[0].text
} else {
text = isZhCN(name) ? cn : us
text = isZhCN(this.demoContext.name) ? cn : us
}
text = text || ''
text = text.split('\n').map(t => t.trim()).join('\n')

View File

@ -1,50 +1,319 @@
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 icon } from 'antd/icon/demo/index.vue'
export { default as input } from 'antd/input/demo/index.vue'
export { default as select } from 'antd/select/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'
export { default as dropdown } from 'antd/dropdown/demo/index.vue'
export { default as divider } from 'antd/divider/demo/index.vue'
export { default as collapse } from 'antd/collapse/demo/index.vue'
export { default as notification } from 'antd/notification/demo/index.vue'
export { default as message } from 'antd/message/demo/index.vue'
export { default as spin } from 'antd/spin/demo/index.vue'
export { default as switch } from 'antd/switch/demo/index.vue'
export { default as autoComplete } from 'antd/auto-complete/demo/index.vue'
export { default as affix } from 'antd/affix/demo/index.vue'
export { default as cascader } from 'antd/cascader/demo/index.vue'
export { default as backTop } from 'antd/back-top/demo/index.vue'
export { default as modal } from 'antd/modal/demo/index.vue'
export { default as alert } from 'antd/alert/demo/index.vue'
export { default as timePicker } from 'antd/time-picker/demo/index.vue'
export { default as steps } from 'antd/steps/demo/index.vue'
export { default as calendar } from 'antd/calendar/demo/index.vue'
export { default as datePicker } from 'antd/date-picker/demo/index.vue'
export { default as localeProvider } from 'antd/locale-provider/demo/index.vue'
export { default as slider } from 'antd/slider/demo/index.vue'
export { default as progress } from 'antd/progress/demo/index.vue'
export { default as timeline } from 'antd/timeline/demo/index.vue'
export { default as table } from 'antd/table/demo/index.vue'
export { default as inputNumber } from 'antd/input-number/demo/index.vue'
export { default as transfer } from 'antd/transfer/demo/index.vue'
export { default as upload } from 'antd/upload/demo/index.vue'
export { default as tree } from 'antd/tree/demo/index.vue'
export { default as treeSelect } from 'antd/tree-select/demo/index.vue'
export { default as layout } from 'antd/layout/demo/index.vue'
export { default as form } from 'antd/form/demo/index.vue'
export { default as anchor } from 'antd/anchor/demo/index.vue'
export { default as list } from 'antd/list/demo/index.vue'
export default {
avatar: {
category: 'Components',
subtitle: '头像',
type: 'Data Display',
title: 'Avatar',
},
badge: {
category: 'Components',
subtitle: '徽标数',
type: 'Data Display',
title: 'Badge',
},
breadcrumb: {
category: 'Components',
subtitle: '面包屑',
type: 'Navigation',
title: 'Breadcrumb',
},
button: {
category: 'Components',
subtitle: '按钮',
type: 'General',
title: 'Button',
},
card: {
category: 'Components',
subtitle: '卡片',
type: 'Data Display',
title: 'Card',
cols: 1,
},
checkbox: {
category: 'Components',
subtitle: '多选框',
type: 'Data Entry',
title: 'Checkbox',
},
grid: {
category: 'Components',
subtitle: '栅格',
type: 'Layout',
title: 'Grid',
cols: 1,
},
icon: {
category: 'Components',
subtitle: '图标',
type: 'General',
title: 'Icon',
},
input: {
category: 'Components',
subtitle: '输入框',
type: 'Data Entry',
title: 'Input',
},
select: {
category: 'Components',
subtitle: '选择器',
type: 'Data Entry',
title: 'Select',
},
menu: {
category: 'Components',
subtitle: '导航菜单',
type: 'Navigation',
title: 'Menu',
cols: 1,
},
pagination: {
category: 'Components',
subtitle: '分页',
type: 'Navigation',
title: 'Pagination',
cols: 1,
},
popconfirm: {
category: 'Components',
subtitle: '气泡确认框',
type: 'Feedback',
title: 'Popconfirm',
},
popover: {
category: 'Components',
subtitle: '气泡卡片',
type: 'Data Display',
title: 'Popover',
},
radio: {
category: 'Components',
subtitle: '单选框',
type: 'Data Entry',
title: 'Radio',
},
rate: {
category: 'Components',
subtitle: '评分',
type: 'Data Entry',
title: 'Rate',
cols: 1,
},
tabs: {
category: 'Components',
subtitle: '标签页',
type: 'Data Display',
title: 'Tabs',
cols: 1,
},
tag: {
category: 'Components',
subtitle: '标签',
type: 'Data Display',
title: 'Tag',
},
tooltip: {
category: 'Components',
subtitle: '文字提示',
type: 'Data Display',
title: 'Tooltip',
},
dropdown: {
category: 'Components',
subtitle: '下拉菜单',
type: 'Navigation',
title: 'Dropdown',
},
divider: {
category: 'Components',
subtitle: '分割线',
type: 'Other',
title: 'Divider',
},
collapse: {
category: 'Components',
subtitle: '折叠面板',
type: 'Data Display',
title: 'Collapse',
cols: 1,
},
notification: {
category: 'Components',
subtitle: '通知提醒框',
type: 'Feedback',
title: 'Notification',
},
message: {
category: 'Components',
subtitle: '全局提示',
type: 'Feedback',
title: 'Message',
},
spin: {
category: 'Components',
subtitle: '加载中',
type: 'Feedback',
title: 'Spin',
},
switch: {
category: 'Components',
subtitle: '开关',
type: 'Data Entry',
title: 'Switch',
},
autoComplete: {
category: 'Components',
subtitle: '自动完成',
type: 'Data Entry',
title: 'AutoComplete',
cols: 2,
},
affix: {
category: 'Components',
subtitle: '固钉',
type: 'Navigation',
title: 'Affix',
},
cascader: {
category: 'Components',
subtitle: '级联选择',
type: 'Data Entry',
title: 'Cascader',
},
backTop: {
category: 'Components',
subtitle: '回到顶部',
type: 'Other',
title: 'BackTop',
},
modal: {
category: 'Components',
subtitle: '对话框',
type: 'Feedback',
title: 'Modal',
},
alert: {
category: 'Components',
subtitle: '警告提示',
type: 'Feedback',
title: 'Alert',
},
timePicker: {
category: 'Components',
subtitle: '时间选择框',
type: 'Data Entry',
title: 'TimePicker',
},
steps: {
category: 'Components',
subtitle: '步骤条',
type: 'Navigation',
title: 'Steps',
cols: 1,
},
calendar: {
category: 'Components',
subtitle: '日历',
type: 'Data Display',
title: 'Calendar',
cols: 1,
},
datePicker: {
category: 'Components',
subtitle: '日期选择框',
type: 'Data Entry',
title: 'DatePicker',
},
localeProvider: {
category: 'Components',
subtitle: '国际化',
type: 'Other',
title: 'LocaleProvider',
cols: 1,
},
slider: {
category: 'Components',
subtitle: '滑动输入条',
type: 'Data Entry',
title: 'Slider',
},
progress: {
category: 'Components',
subtitle: '进度条',
type: 'Feedback',
title: 'Progress',
},
timeline: {
category: 'Components',
subtitle: '时间轴',
type: 'Data Display',
title: 'Timeline',
},
table: {
category: 'Components',
subtitle: '表格',
type: 'Data Display',
title: 'Table',
cols: 1,
},
inputNumber: {
category: 'Components',
subtitle: '数字输入框',
type: 'Data Entry',
title: 'InputNumber',
},
transfer: {
category: 'Components',
subtitle: '穿梭框',
type: 'Data Entry',
title: 'Transfer',
cols: '1',
},
upload: {
category: 'Components',
subtitle: '上传',
type: 'Data Entry',
title: 'Upload',
},
tree: {
category: 'Components',
subtitle: '树形控件',
type: 'Data Display',
title: 'Tree',
},
treeSelect: {
category: 'Components',
subtitle: '树选择',
type: 'Data Entry',
title: 'TreeSelect',
},
layout: {
category: 'Components',
subtitle: '布局',
type: 'Layout',
title: 'Layout',
cols: 1,
},
form: {
category: 'Components',
subtitle: '表单',
type: 'Data Entry',
title: 'Form',
cols: 1,
},
anchor: {
category: 'Components',
subtitle: '锚点',
type: 'Other',
title: 'Anchor',
cols: 2,
},
list: {
category: 'Components',
subtitle: '列表',
type: 'Data Display',
title: 'List',
cols: 1,
},
}

402
site/demoRoutes.js Normal file
View File

@ -0,0 +1,402 @@
export default [
{
path: 'avatar',
component: () => import('../components/avatar/demo/index.vue'),
},
{
path: 'avatar-cn',
component: () => import('../components/avatar/demo/index.vue'),
},
{
path: 'badge',
component: () => import('../components/badge/demo/index.vue'),
},
{
path: 'badge-cn',
component: () => import('../components/badge/demo/index.vue'),
},
{
path: 'breadcrumb',
component: () => import('../components/breadcrumb/demo/index.vue'),
},
{
path: 'breadcrumb-cn',
component: () => import('../components/breadcrumb/demo/index.vue'),
},
{
path: 'button',
component: () => import('../components/button/demo/index.vue'),
},
{
path: 'button-cn',
component: () => import('../components/button/demo/index.vue'),
},
{
path: 'card',
component: () => import('../components/card/demo/index.vue'),
},
{
path: 'card-cn',
component: () => import('../components/card/demo/index.vue'),
},
{
path: 'checkbox',
component: () => import('../components/checkbox/demo/index.vue'),
},
{
path: 'checkbox-cn',
component: () => import('../components/checkbox/demo/index.vue'),
},
{
path: 'grid',
component: () => import('../components/grid/demo/index.vue'),
},
{
path: 'grid-cn',
component: () => import('../components/grid/demo/index.vue'),
},
{
path: 'icon',
component: () => import('../components/icon/demo/index.vue'),
},
{
path: 'icon-cn',
component: () => import('../components/icon/demo/index.vue'),
},
{
path: 'input',
component: () => import('../components/input/demo/index.vue'),
},
{
path: 'input-cn',
component: () => import('../components/input/demo/index.vue'),
},
{
path: 'select',
component: () => import('../components/select/demo/index.vue'),
},
{
path: 'select-cn',
component: () => import('../components/select/demo/index.vue'),
},
{
path: 'menu',
component: () => import('../components/menu/demo/index.vue'),
},
{
path: 'menu-cn',
component: () => import('../components/menu/demo/index.vue'),
},
{
path: 'pagination',
component: () => import('../components/pagination/demo/index.vue'),
},
{
path: 'pagination-cn',
component: () => import('../components/pagination/demo/index.vue'),
},
{
path: 'popconfirm',
component: () => import('../components/popconfirm/demo/index.vue'),
},
{
path: 'popconfirm-cn',
component: () => import('../components/popconfirm/demo/index.vue'),
},
{
path: 'popover',
component: () => import('../components/popover/demo/index.vue'),
},
{
path: 'popover-cn',
component: () => import('../components/popover/demo/index.vue'),
},
{
path: 'radio',
component: () => import('../components/radio/demo/index.vue'),
},
{
path: 'radio-cn',
component: () => import('../components/radio/demo/index.vue'),
},
{
path: 'rate',
component: () => import('../components/rate/demo/index.vue'),
},
{
path: 'rate-cn',
component: () => import('../components/rate/demo/index.vue'),
},
{
path: 'tabs',
component: () => import('../components/tabs/demo/index.vue'),
},
{
path: 'tabs-cn',
component: () => import('../components/tabs/demo/index.vue'),
},
{
path: 'tag',
component: () => import('../components/tag/demo/index.vue'),
},
{
path: 'tag-cn',
component: () => import('../components/tag/demo/index.vue'),
},
{
path: 'tooltip',
component: () => import('../components/tooltip/demo/index.vue'),
},
{
path: 'tooltip-cn',
component: () => import('../components/tooltip/demo/index.vue'),
},
{
path: 'dropdown',
component: () => import('../components/dropdown/demo/index.vue'),
},
{
path: 'dropdown-cn',
component: () => import('../components/dropdown/demo/index.vue'),
},
{
path: 'divider',
component: () => import('../components/divider/demo/index.vue'),
},
{
path: 'divider-cn',
component: () => import('../components/divider/demo/index.vue'),
},
{
path: 'collapse',
component: () => import('../components/collapse/demo/index.vue'),
},
{
path: 'collapse-cn',
component: () => import('../components/collapse/demo/index.vue'),
},
{
path: 'notification',
component: () => import('../components/notification/demo/index.vue'),
},
{
path: 'notification-cn',
component: () => import('../components/notification/demo/index.vue'),
},
{
path: 'message',
component: () => import('../components/message/demo/index.vue'),
},
{
path: 'message-cn',
component: () => import('../components/message/demo/index.vue'),
},
{
path: 'spin',
component: () => import('../components/spin/demo/index.vue'),
},
{
path: 'spin-cn',
component: () => import('../components/spin/demo/index.vue'),
},
{
path: 'switch',
component: () => import('../components/switch/demo/index.vue'),
},
{
path: 'switch-cn',
component: () => import('../components/switch/demo/index.vue'),
},
{
path: 'auto-complete',
component: () => import('../components/auto-complete/demo/index.vue'),
},
{
path: 'auto-complete-cn',
component: () => import('../components/auto-complete/demo/index.vue'),
},
{
path: 'affix',
component: () => import('../components/affix/demo/index.vue'),
},
{
path: 'affix-cn',
component: () => import('../components/affix/demo/index.vue'),
},
{
path: 'cascader',
component: () => import('../components/cascader/demo/index.vue'),
},
{
path: 'cascader-cn',
component: () => import('../components/cascader/demo/index.vue'),
},
{
path: 'back-top',
component: () => import('../components/back-top/demo/index.vue'),
},
{
path: 'back-top-cn',
component: () => import('../components/back-top/demo/index.vue'),
},
{
path: 'modal',
component: () => import('../components/modal/demo/index.vue'),
},
{
path: 'modal-cn',
component: () => import('../components/modal/demo/index.vue'),
},
{
path: 'alert',
component: () => import('../components/alert/demo/index.vue'),
},
{
path: 'alert-cn',
component: () => import('../components/alert/demo/index.vue'),
},
{
path: 'time-picker',
component: () => import('../components/time-picker/demo/index.vue'),
},
{
path: 'time-picker-cn',
component: () => import('../components/time-picker/demo/index.vue'),
},
{
path: 'steps',
component: () => import('../components/steps/demo/index.vue'),
},
{
path: 'steps-cn',
component: () => import('../components/steps/demo/index.vue'),
},
{
path: 'calendar',
component: () => import('../components/calendar/demo/index.vue'),
},
{
path: 'calendar-cn',
component: () => import('../components/calendar/demo/index.vue'),
},
{
path: 'date-picker',
component: () => import('../components/date-picker/demo/index.vue'),
},
{
path: 'date-picker-cn',
component: () => import('../components/date-picker/demo/index.vue'),
},
{
path: 'locale-provider',
component: () => import('../components/locale-provider/demo/index.vue'),
},
{
path: 'locale-provider-cn',
component: () => import('../components/locale-provider/demo/index.vue'),
},
{
path: 'slider',
component: () => import('../components/slider/demo/index.vue'),
},
{
path: 'slider-cn',
component: () => import('../components/slider/demo/index.vue'),
},
{
path: 'progress',
component: () => import('../components/progress/demo/index.vue'),
},
{
path: 'progress-cn',
component: () => import('../components/progress/demo/index.vue'),
},
{
path: 'timeline',
component: () => import('../components/timeline/demo/index.vue'),
},
{
path: 'timeline-cn',
component: () => import('../components/timeline/demo/index.vue'),
},
{
path: 'table',
component: () => import('../components/table/demo/index.vue'),
},
{
path: 'table-cn',
component: () => import('../components/table/demo/index.vue'),
},
{
path: 'input-number',
component: () => import('../components/input-number/demo/index.vue'),
},
{
path: 'input-number-cn',
component: () => import('../components/input-number/demo/index.vue'),
},
{
path: 'transfer',
component: () => import('../components/transfer/demo/index.vue'),
},
{
path: 'transfer-cn',
component: () => import('../components/transfer/demo/index.vue'),
},
{
path: 'upload',
component: () => import('../components/upload/demo/index.vue'),
},
{
path: 'upload-cn',
component: () => import('../components/upload/demo/index.vue'),
},
{
path: 'tree',
component: () => import('../components/tree/demo/index.vue'),
},
{
path: 'tree-cn',
component: () => import('../components/tree/demo/index.vue'),
},
{
path: 'tree-select',
component: () => import('../components/tree-select/demo/index.vue'),
},
{
path: 'tree-select-cn',
component: () => import('../components/tree-select/demo/index.vue'),
},
{
path: 'layout',
component: () => import('../components/layout/demo/index.vue'),
},
{
path: 'layout-cn',
component: () => import('../components/layout/demo/index.vue'),
},
{
path: 'form',
component: () => import('../components/form/demo/index.vue'),
},
{
path: 'form-cn',
component: () => import('../components/form/demo/index.vue'),
},
{
path: 'anchor',
component: () => import('../components/anchor/demo/index.vue'),
},
{
path: 'anchor-cn',
component: () => import('../components/anchor/demo/index.vue'),
},
{
path: 'list',
component: () => import('../components/list/demo/index.vue'),
},
{
path: 'list-cn',
component: () => import('../components/list/demo/index.vue'),
},
]

View File

@ -5,6 +5,9 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/vueComponent/ant-design/master/logo.png">
</head>
@ -14,4 +17,4 @@
</div>
</body>
</html>
</html>

View File

@ -1,15 +1,32 @@
import Layout from './components/layout.vue'
import Iframe from './components/iframe.vue'
import demoRoutes from './demoRoutes'
export default [
{ path: '/ant-design/components/:name/', component: Layout, props: true },
{ path: '/ant-design/iframe/:name/', component: Iframe, props: true },
{ path: '/ant-design/components',
component: Layout,
props: (route) => {
const name = route.path.split('/ant-design/components/')[1].split('/')[0]
return { name, showDemo: true }
},
children: demoRoutes,
},
{ path: '/ant-design/iframe',
component: Iframe,
children: demoRoutes.map((item) => ({
...item,
props: (route) => {
const hash = route.hash.replace('#', '')
return { iframeName: hash }
},
})),
},
{
path: '/ant-design',
component: Layout,
props: (route) => {
const name = route.path.split('/docs/vue/')[1].split('/')[0]
return { name }
return { name, showApi: true }
},
children: [
{

View File

@ -64,9 +64,6 @@ module.exports = merge(baseWebpackConfig, {
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vender',
minChunks: function (module) {
return module.context && ~module.context.indexOf('node_modules')
},
}),
new webpack.optimize.UglifyJsPlugin({
compress: {