Skip to content

Commit c816086

Browse files
committed
docs: updatedoc
1 parent fce1856 commit c816086

File tree

8 files changed

+70
-18
lines changed

8 files changed

+70
-18
lines changed

build/dev.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ let { componentName } = require('./config').dev;
2828
const componentsInPrototype = ['Modal', 'message', 'notification'];
2929

3030
const MAIN_TEMPLATE = `import 'babel-polyfill';
31-
import './index.less';
3231
import 'highlight.js/styles/solarized-light.css';
3332
import Vue from 'vue';
3433
import Vuex from 'vuex';
@@ -38,6 +37,7 @@ import VueClipboard from 'vue-clipboard2';
3837
import Md from './components/md';
3938
import Api from './components/api';
4039
import demoBox from './components/demoBox';
40+
import demoSort from './components/demoSort';
4141
import demoContainer from './components/demoContainer';
4242
import Modal from '../components/modal';
4343
import message from '../components/message';
@@ -50,6 +50,7 @@ import '../components/notification/style';
5050
import Test from '../components/{{name}}/demo/index.vue';
5151
import zhCN from './theme/zh-CN';
5252
import enUS from './theme/en-US';
53+
import './index.less';
5354
5455
Vue.use(Vuex);
5556
Vue.use(VueClipboard);
@@ -58,6 +59,7 @@ Vue.use(VueI18n);
5859
Vue.component(Md.name, Md);
5960
Vue.component(Api.name, Api);
6061
Vue.component('demo-box', demoBox);
62+
Vue.component('demo-sort', demoSort);
6163
Vue.component('demo-container', demoContainer);
6264
6365
Vue.prototype.$message = message;

components/tree/demo/index.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@ export default {
3737
return (
3838
<div>
3939
<md cn={md.cn} us={md.us} />
40-
<BasicControlled />
41-
<Basic />
42-
<ReplaceFields />
43-
<CustomizedIcon />
44-
<Draggable />
45-
<Dynamic />
46-
<Line />
47-
<Search />
48-
<Directory />
49-
<SwitcherIcon />
40+
<demo-sort cols="2">
41+
<BasicControlled />
42+
<Basic />
43+
<ReplaceFields />
44+
<CustomizedIcon />
45+
<Draggable />
46+
<Dynamic />
47+
<Line />
48+
<Search />
49+
<Directory />
50+
<SwitcherIcon />
51+
</demo-sort>
5052
<api>
5153
<template slot="cn">
5254
<CN />

site/components/api.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import { isZhCN } from '../util';
1010
import GoogleAds from './GoogleAds';
1111
export default {
12+
name: 'Api',
1213
components: {
1314
GoogleAds,
1415
},
15-
name: 'Api',
1616
inject: {
1717
demoContext: { default: {} },
1818
},

site/components/demoBox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default {
106106
sourceCode,
107107
id,
108108
iframeDemoKey,
109+
isDemo: true,
109110
};
110111
},
111112
methods: {

site/components/demoSort.jsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { Col, Row } from '../../components/grid';
2+
import '../../components/grid/style';
3+
function isEmptyElement(c) {
4+
return !(c.tag || (c.text && c.text.trim() !== ''));
5+
}
6+
7+
function filterEmpty(children = []) {
8+
return children.filter(c => !isEmptyElement(c));
9+
}
10+
export default {
11+
props: {
12+
cols: {
13+
type: [Number, String],
14+
default: 1,
15+
},
16+
},
17+
inject: {
18+
demoContext: { default: {} },
19+
},
20+
render() {
21+
const { cols, $slots } = this;
22+
const isSingleCol = cols === 1;
23+
const leftChildren = [];
24+
const rightChildren = [];
25+
const children = filterEmpty($slots.default);
26+
children.forEach((demo, index) => {
27+
if (index % 2 === 0 || isSingleCol) {
28+
leftChildren.push(demo);
29+
} else {
30+
rightChildren.push(demo);
31+
}
32+
});
33+
return (
34+
<Row gutter={16}>
35+
<Col
36+
span={isSingleCol ? 24 : 12}
37+
class={isSingleCol ? 'code-boxes-col-1-1' : 'code-boxes-col-2-1'}
38+
>
39+
{leftChildren}
40+
</Col>
41+
{isSingleCol ? null : (
42+
<Col class="code-boxes-col-2-1" span={12}>
43+
{rightChildren}
44+
</Col>
45+
)}
46+
</Row>
47+
);
48+
},
49+
};

site/components/layout.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ const docsList = [
2929
{ key: 'download', enTitle: 'Download Design Resources', title: '下载设计资源' },
3030
];
3131
32-
let isMobile = false;
3332
const isGitee = window.location.host.indexOf('gitee.io') > -1;
34-
enquireScreen(b => {
35-
isMobile = b;
36-
});
3733
const showAd = location.host.indexOf('antdv.com') > -1;
3834
export default {
3935
props: {
@@ -50,7 +46,7 @@ export default {
5046
showSideBars: true,
5147
currentSubMenu: [],
5248
sidebarHeight: document.documentElement.offsetHeight,
53-
isMobile,
49+
isMobile: false,
5450
};
5551
},
5652
provide() {

site/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Api from './components/api';
1515
import './components';
1616
import demoBox from './components/demoBox';
1717
import demoContainer from './components/demoContainer';
18+
import demoSort from './components/demoSort';
1819
import zhCN from './theme/zh-CN';
1920
import enUS from './theme/en-US';
2021
import { isZhCN } from './util';
@@ -38,6 +39,7 @@ Vue.component(Md.name, Md);
3839
Vue.component(Api.name, Api);
3940
Vue.component('demo-box', demoBox);
4041
Vue.component('demo-container', demoContainer);
42+
Vue.component('demo-sort', demoSort);
4143

4244
const i18n = new VueI18n({
4345
locale: isZhCN(location.pathname) ? zhCN.locale : enUS.locale,

site/theme/static/responsive.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
}
3030

31-
@media only screen and (max-width: 767.99px) {
31+
@media only screen and (max-width: 992px) {
3232
#header {
3333
text-align: center;
3434
#logo {

0 commit comments

Comments
 (0)