doc: update doc
parent
ad81186ec5
commit
d232bf65f3
|
@ -145,14 +145,10 @@ function tag() {
|
||||||
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
|
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
|
||||||
execSync(`git tag ${version}`);
|
execSync(`git tag ${version}`);
|
||||||
execSync(
|
execSync(
|
||||||
`git push https://${
|
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
|
||||||
process.env.GITHUB_TOKEN
|
|
||||||
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
|
|
||||||
);
|
);
|
||||||
execSync(
|
execSync(
|
||||||
`git push https://${
|
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
|
||||||
process.env.GITHUB_TOKEN
|
|
||||||
}@github.com/vueComponent/ant-design-vue.git master:master`,
|
|
||||||
);
|
);
|
||||||
console.log('tagged');
|
console.log('tagged');
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,9 +110,7 @@ export default {
|
||||||
if (settings.centerMode) {
|
if (settings.centerMode) {
|
||||||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
|
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
|
||||||
console.warn(
|
console.warn(
|
||||||
`slidesToScroll should be equal to 1 in centerMode, you are using ${
|
`slidesToScroll should be equal to 1 in centerMode, you are using ${settings.slidesToScroll}`,
|
||||||
settings.slidesToScroll
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
settings.slidesToScroll = 1;
|
settings.slidesToScroll = 1;
|
||||||
|
@ -121,16 +119,12 @@ export default {
|
||||||
if (settings.fade) {
|
if (settings.fade) {
|
||||||
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') {
|
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') {
|
||||||
console.warn(
|
console.warn(
|
||||||
`slidesToShow should be equal to 1 when fade is true, you're using ${
|
`slidesToShow should be equal to 1 when fade is true, you're using ${settings.slidesToShow}`,
|
||||||
settings.slidesToShow
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
|
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
|
||||||
console.warn(
|
console.warn(
|
||||||
`slidesToScroll should be equal to 1 when fade is true, you're using ${
|
`slidesToScroll should be equal to 1 when fade is true, you're using ${settings.slidesToScroll}`,
|
||||||
settings.slidesToScroll
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
settings.slidesToShow = 1;
|
settings.slidesToShow = 1;
|
||||||
|
|
|
@ -376,9 +376,7 @@ function processEntity(entity, wrapper) {
|
||||||
if (currentEntity) {
|
if (currentEntity) {
|
||||||
warning(
|
warning(
|
||||||
false,
|
false,
|
||||||
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${
|
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${currentEntity.key}'.`,
|
||||||
currentEntity.key
|
|
||||||
}'.`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
wrapper.valueEntities[value] = entity;
|
wrapper.valueEntities[value] = entity;
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
const carbonUrls = {
|
const carbonUrls = {
|
||||||
'vuecomponent.github.io': '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio',
|
'vuecomponent.github.io':
|
||||||
'tangjinzhou.gitee.io':'//cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=tangjinzhougiteeio',
|
'//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio',
|
||||||
'ant-design-vue.gitee.io':'//cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=antdesignvuegiteeio',
|
'tangjinzhou.gitee.io':
|
||||||
|
'//cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=tangjinzhougiteeio',
|
||||||
|
'ant-design-vue.gitee.io':
|
||||||
|
'//cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=antdesignvuegiteeio',
|
||||||
'vue.ant.design': '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign',
|
'vue.ant.design': '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign',
|
||||||
};
|
};
|
||||||
const carbonUrl = carbonUrls[location.host] || '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign';
|
const carbonUrl =
|
||||||
|
carbonUrls[location.host] ||
|
||||||
|
'//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign';
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
isMobile: Boolean,
|
isMobile: Boolean,
|
||||||
|
@ -18,17 +23,16 @@ export default {
|
||||||
// adId = '#cf';
|
// adId = '#cf';
|
||||||
// }
|
// }
|
||||||
if (e.path !== t.path && this.$el.querySelector(adId)) {
|
if (e.path !== t.path && this.$el.querySelector(adId)) {
|
||||||
this.$el.innerHTML = "";
|
this.$el.innerHTML = '';
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
this.adInterval && clearInterval(this.adInterval);
|
this.adInterval && clearInterval(this.adInterval);
|
||||||
this.adInterval = setInterval(() => {
|
this.adInterval = setInterval(() => {
|
||||||
if (!this.$el.querySelector(adId)) {
|
if (!this.$el.querySelector(adId)) {
|
||||||
this.$el.innerHTML = "";
|
this.$el.innerHTML = '';
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -43,33 +47,33 @@ export default {
|
||||||
// });
|
// });
|
||||||
// } else
|
// } else
|
||||||
if (carbonUrl) {
|
if (carbonUrl) {
|
||||||
const e = document.createElement("script");
|
const e = document.createElement('script');
|
||||||
e.id = "_carbonads_js";
|
e.id = '_carbonads_js';
|
||||||
e.src = carbonUrl;
|
e.src = carbonUrl;
|
||||||
this.$el.appendChild(e);
|
this.$el.appendChild(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
return (
|
return <div id="carbon-ads" class={this.isMobile ? 'carbon-mobile' : ''} />;
|
||||||
<div id="carbon-ads" class={this.isMobile ? 'carbon-mobile':''}/>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
#carbon-ads {
|
#carbon-ads {
|
||||||
width: 266px;
|
width: 280px;
|
||||||
position: fixed;
|
float: right;
|
||||||
left: 0;
|
position: relative;
|
||||||
bottom: 0px;
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
border-radius: 3px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
|
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
|
||||||
}
|
}
|
||||||
#carbonads {
|
#carbonads {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
height="100"
|
height="100"
|
||||||
alt="浏览器工作原理与实践"
|
alt="浏览器工作原理与实践"
|
||||||
src="http://pvrd7go2h.bkt.clouddn.com/geektime-browser.jpeg"
|
src="http://pvrd7go2h.bkt.clouddn.com/geektime-browser.jpeg"
|
||||||
>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -40,12 +40,10 @@ export default {
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
#geektime-ads {
|
#geektime-ads {
|
||||||
max-width: 280px;
|
width: 266px;
|
||||||
height: 100px;
|
position: fixed;
|
||||||
float: right;
|
left: 0;
|
||||||
position: relative;
|
bottom: 0px;
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
|
|
|
@ -119,9 +119,9 @@ export default {
|
||||||
});
|
});
|
||||||
const showApi = this.$route.path.indexOf('/components/') !== -1;
|
const showApi = this.$route.path.indexOf('/components/') !== -1;
|
||||||
return (
|
return (
|
||||||
<a-anchor offsetTop={100} class='demo-anchor'>
|
<a-anchor offsetTop={100} class="demo-anchor">
|
||||||
{lis}
|
{lis}
|
||||||
{showApi ? <a-anchor-link key='API' title='API' href='#API' /> : ''}
|
{showApi ? <a-anchor-link key="API" title="API" href="#API" /> : ''}
|
||||||
</a-anchor>
|
</a-anchor>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -129,13 +129,12 @@ export default {
|
||||||
const docsMenu = [];
|
const docsMenu = [];
|
||||||
docsList.forEach(({ key, enTitle, title }, index) => {
|
docsList.forEach(({ key, enTitle, title }, index) => {
|
||||||
const k = isCN ? `${key}-cn` : key;
|
const k = isCN ? `${key}-cn` : key;
|
||||||
pagesKey.push({ name: k,
|
pagesKey.push({ name: k, url: `/docs/vue/${k}/`, title: isCN ? title : enTitle });
|
||||||
url: `/docs/vue/${k}/`,
|
docsMenu.push(
|
||||||
title: isCN ? title : enTitle,
|
<a-menu-item key={k}>
|
||||||
});
|
|
||||||
docsMenu.push(<a-menu-item key={k}>
|
|
||||||
<router-link to={`/docs/vue/${k}/`}>{isCN ? title : enTitle}</router-link>
|
<router-link to={`/docs/vue/${k}/`}>{isCN ? title : enTitle}</router-link>
|
||||||
</a-menu-item>);
|
</a-menu-item>,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
return docsMenu;
|
return docsMenu;
|
||||||
},
|
},
|
||||||
|
@ -146,7 +145,7 @@ export default {
|
||||||
const componentName = isCN ? subtitle + ' ' + title : title;
|
const componentName = isCN ? subtitle + ' ' + title : title;
|
||||||
titleStr = componentName + ' - ' + titleStr;
|
titleStr = componentName + ' - ' + titleStr;
|
||||||
} else {
|
} else {
|
||||||
const currentKey = docsList.filter((item) => {
|
const currentKey = docsList.filter(item => {
|
||||||
return item.key === name;
|
return item.key === name;
|
||||||
});
|
});
|
||||||
if (currentKey.length) {
|
if (currentKey.length) {
|
||||||
|
@ -193,7 +192,7 @@ export default {
|
||||||
const MenuItems = [];
|
const MenuItems = [];
|
||||||
sortBy(menus, ['title']).forEach(({ title, subtitle }) => {
|
sortBy(menus, ['title']).forEach(({ title, subtitle }) => {
|
||||||
const linkValue = isCN
|
const linkValue = isCN
|
||||||
? [<span>{title}</span>, <span class='chinese'>{subtitle}</span>]
|
? [<span>{title}</span>, <span class="chinese">{subtitle}</span>]
|
||||||
: [<span>{title}</span>];
|
: [<span>{title}</span>];
|
||||||
let key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`;
|
let key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`;
|
||||||
if (isCN) {
|
if (isCN) {
|
||||||
|
@ -209,9 +208,11 @@ export default {
|
||||||
subtitle,
|
subtitle,
|
||||||
url: `/components/${key}/`,
|
url: `/components/${key}/`,
|
||||||
});
|
});
|
||||||
MenuItems.push(<a-menu-item key={key}>
|
MenuItems.push(
|
||||||
|
<a-menu-item key={key}>
|
||||||
<router-link to={`/components/${key}/`}>{linkValue}</router-link>
|
<router-link to={`/components/${key}/`}>{linkValue}</router-link>
|
||||||
</a-menu-item>);
|
</a-menu-item>,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
MenuGroup.push(<a-menu-item-group title={type}>{MenuItems}</a-menu-item-group>);
|
MenuGroup.push(<a-menu-item-group title={type}>{MenuItems}</a-menu-item-group>);
|
||||||
}
|
}
|
||||||
|
@ -229,78 +230,118 @@ export default {
|
||||||
this.resetDocumentTitle(config, reName, isCN);
|
this.resetDocumentTitle(config, reName, isCN);
|
||||||
const { isMobile } = this;
|
const { isMobile } = this;
|
||||||
return (
|
return (
|
||||||
<div class='page-wrapper'>
|
<div class="page-wrapper">
|
||||||
<Header searchData={searchData} name={name} />
|
<Header searchData={searchData} name={name} />
|
||||||
<a-locale-provider locale={locale}>
|
<a-locale-provider locale={locale}>
|
||||||
<div class='main-wrapper'>
|
<div class="main-wrapper">
|
||||||
<a-row>
|
<a-row>
|
||||||
{isMobile ? <MobileMenu ref='sidebar' wrapperClassName='drawer-wrapper'>
|
{isMobile ? (
|
||||||
|
<MobileMenu ref="sidebar" wrapperClassName="drawer-wrapper">
|
||||||
<a-menu
|
<a-menu
|
||||||
class='aside-container menu-site'
|
class="aside-container menu-site"
|
||||||
selectedKeys={[name]}
|
selectedKeys={[name]}
|
||||||
defaultOpenKeys={['Components']}
|
defaultOpenKeys={['Components']}
|
||||||
inlineIndent={40}
|
inlineIndent={40}
|
||||||
mode='inline'>
|
mode="inline"
|
||||||
|
>
|
||||||
{docsMenu}
|
{docsMenu}
|
||||||
<a-sub-menu title={`Components(${searchData.length})`} key='Components'>
|
<a-sub-menu title={`Components(${searchData.length})`} key="Components">
|
||||||
{MenuGroup}
|
{MenuGroup}
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</MobileMenu>
|
</MobileMenu>
|
||||||
:
|
) : (
|
||||||
<a-col ref='sidebar' class='site-sidebar main-menu' xxl={4} xl={5} lg={5} md={6} sm={8} xs={12}>
|
<a-col
|
||||||
|
ref="sidebar"
|
||||||
|
class="site-sidebar main-menu"
|
||||||
|
xxl={4}
|
||||||
|
xl={5}
|
||||||
|
lg={5}
|
||||||
|
md={6}
|
||||||
|
sm={8}
|
||||||
|
xs={12}
|
||||||
|
>
|
||||||
<a-affix>
|
<a-affix>
|
||||||
<section class="main-menu-inner">
|
<section class="main-menu-inner">
|
||||||
<Sponsors title={isCN ? '赞助商' : 'Sponsors'} />
|
<Sponsors title={isCN ? '赞助商' : 'Sponsors'} />
|
||||||
<a-menu
|
<a-menu
|
||||||
class='aside-container menu-site'
|
class="aside-container menu-site"
|
||||||
selectedKeys={[name]}
|
selectedKeys={[name]}
|
||||||
defaultOpenKeys={['Components']}
|
defaultOpenKeys={['Components']}
|
||||||
inlineIndent={40}
|
inlineIndent={40}
|
||||||
mode='inline'>
|
mode="inline"
|
||||||
|
>
|
||||||
{docsMenu}
|
{docsMenu}
|
||||||
<a-sub-menu title={`Components(${searchData.length})`} key='Components'>
|
<a-sub-menu title={`Components(${searchData.length})`} key="Components">
|
||||||
{MenuGroup}
|
{MenuGroup}
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</section>
|
</section>
|
||||||
</a-affix>
|
</a-affix>
|
||||||
</a-col>
|
</a-col>
|
||||||
}
|
)}
|
||||||
<a-col xxl={20} xl={19} lg={19} md={18} sm={24} xs={24}>
|
<a-col xxl={20} xl={19} lg={19} md={18} sm={24} xs={24}>
|
||||||
<section class='main-container main-container-component'>
|
<section class="main-container main-container-component">
|
||||||
<CarbonAds isMobile={isMobile} />
|
<CarbonAds isMobile={isMobile} />
|
||||||
<GeektimeAds isMobile={isMobile} />
|
<GeektimeAds isMobile={isMobile} />
|
||||||
{!isMobile ? <div class='toc-affix' style='width: 150px;'>
|
{!isMobile ? (
|
||||||
|
<div class="toc-affix" style="width: 150px;">
|
||||||
{this.getSubMenu(isCN)}
|
{this.getSubMenu(isCN)}
|
||||||
</div> : null}
|
</div>
|
||||||
{this.showDemo ? <Provider store={this.store} key={isCN ? 'cn' : 'en'}>
|
) : null}
|
||||||
|
{this.showDemo ? (
|
||||||
|
<Provider store={this.store} key={isCN ? 'cn' : 'en'}>
|
||||||
<router-view
|
<router-view
|
||||||
class={`demo-cols-${config.cols || 2}`}
|
class={`demo-cols-${config.cols || 2}`}
|
||||||
{...{ directives: [
|
{...{
|
||||||
|
directives: [
|
||||||
{
|
{
|
||||||
name: 'mountedCallback',
|
name: 'mountedCallback',
|
||||||
value: this.mountedCallback,
|
value: this.mountedCallback,
|
||||||
},
|
},
|
||||||
] }}
|
],
|
||||||
|
}}
|
||||||
></router-view>
|
></router-view>
|
||||||
</Provider> : ''}
|
</Provider>
|
||||||
{this.showApi ? <div class='markdown api-container' ref='doc'>
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
|
{this.showApi ? (
|
||||||
|
<div class="markdown api-container" ref="doc">
|
||||||
<router-view
|
<router-view
|
||||||
{...{ directives: [
|
{...{
|
||||||
|
directives: [
|
||||||
{
|
{
|
||||||
name: 'mountedCallback',
|
name: 'mountedCallback',
|
||||||
value: this.mountedCallback,
|
value: this.mountedCallback,
|
||||||
},
|
},
|
||||||
] }}
|
],
|
||||||
|
}}
|
||||||
></router-view>
|
></router-view>
|
||||||
</div> : ''}
|
</div>
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
<section class='prev-next-nav'>
|
<section class="prev-next-nav">
|
||||||
{prevPage ? <router-link class='prev-page' to={`${prevPage.url}`}><a-icon type='left' /> {prevPage.title}</router-link> : ''}
|
{prevPage ? (
|
||||||
{nextPage ? <router-link class='next-page' to={`${nextPage.url}`}>{nextPage.title} <a-icon type='right' /></router-link> : ''}
|
<router-link class="prev-page" to={`${prevPage.url}`}>
|
||||||
|
<a-icon type="left" />
|
||||||
|
{prevPage.title}
|
||||||
|
</router-link>
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
|
{nextPage ? (
|
||||||
|
<router-link class="next-page" to={`${nextPage.url}`}>
|
||||||
|
{nextPage.title}
|
||||||
|
<a-icon type="right" />
|
||||||
|
</router-link>
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
<Footer ref='footer' isCN={isCN}/>
|
<Footer ref="footer" isCN={isCN} />
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue