doc: update

pull/5340/head
tangjinzhou 2022-03-15 09:51:18 +08:00
parent 2efe1af6b6
commit 2b8bdf3b1d
4 changed files with 78 additions and 13 deletions

View File

@ -28,7 +28,6 @@
<Summary /> <Summary />
<Responsive /> <Responsive />
<TemplateCom /> <TemplateCom />
<bigData />
</demo-sort> </demo-sort>
</template> </template>
@ -61,7 +60,6 @@ import MultipleSorter from './multiple-sorter.vue';
import Summary from './summary.vue'; import Summary from './summary.vue';
import Sticky from './sticky.vue'; import Sticky from './sticky.vue';
import ResizableColumn from './resizable-column.vue'; import ResizableColumn from './resizable-column.vue';
import bigData from './big-data.vue';
import Responsive from './responsive.vue'; import Responsive from './responsive.vue';
import CN from '../index.zh-CN.md'; import CN from '../index.zh-CN.md';
import US from '../index.en-US.md'; import US from '../index.en-US.md';
@ -98,7 +96,6 @@ export default defineComponent({
Summary, Summary,
Sticky, Sticky,
ResizableColumn, ResizableColumn,
bigData,
Responsive, Responsive,
}, },
}); });

View File

@ -5,7 +5,7 @@
<img height="80" src="https://www.surely.cool/surely-vue-logo.png" alt="" /> <img height="80" src="https://www.surely.cool/surely-vue-logo.png" alt="" />
</div> </div>
<div class="desc"> <div class="desc">
<div class="title">高性能 Surely Vue</div> <div class="title">Surely Vue</div>
<div class="sub-title"> <div class="sub-title">
构建更快的网站 构建更快的网站
<br /> <br />

View File

@ -48,8 +48,13 @@
v-for="h in headers" v-for="h in headers"
:key="h.title" :key="h.title"
:href="h.href || `#${slugifyTitle(h.title)}`" :href="h.href || `#${slugifyTitle(h.title)}`"
:title="h.title" :target="h.target"
></a-anchor-link> >
<template #title>
<LinkOutlined v-if="h.target" />
{{ isZhCN ? h.title : h.enTitle || h.title }}
</template>
</a-anchor-link>
</a-anchor> </a-anchor>
</a-affix> </a-affix>
</section> </section>
@ -90,7 +95,7 @@ import useMenus from '../hooks/useMenus';
import TopAd from '../components/rice/top_rice.vue'; import TopAd from '../components/rice/top_rice.vue';
import Sponsors from '../components/rice/sponsors.vue'; import Sponsors from '../components/rice/sponsors.vue';
import RightBottomAd from '../components/rice/right_bottom_rice.vue'; import RightBottomAd from '../components/rice/right_bottom_rice.vue';
import { CloseOutlined, MenuOutlined } from '@ant-design/icons-vue'; import { CloseOutlined, MenuOutlined, LinkOutlined } from '@ant-design/icons-vue';
import ThemeIcon from './ThemeIcon.vue'; import ThemeIcon from './ThemeIcon.vue';
import surelyVueVue from '../components/surelyVue.vue'; import surelyVueVue from '../components/surelyVue.vue';
import WWAdsVue from '../components/rice/WWAds.vue'; import WWAdsVue from '../components/rice/WWAds.vue';
@ -114,6 +119,7 @@ export default defineComponent({
ThemeIcon, ThemeIcon,
surelyVueVue, surelyVueVue,
WWAdsVue, WWAdsVue,
LinkOutlined,
}, },
setup() { setup() {
const visible = ref(false); const visible = ref(false);
@ -147,6 +153,9 @@ export default defineComponent({
route.path.indexOf('/components') === 0 && route.path.indexOf('/components/overview') !== 0 route.path.indexOf('/components') === 0 && route.path.indexOf('/components/overview') !== 0
); );
}); });
const isTablePage = computed(() => {
return route.path.indexOf('/components/table') === 0;
});
const matchCom = computed(() => { const matchCom = computed(() => {
return route.matched[route.matched.length - 1]?.components?.default; return route.matched[route.matched.length - 1]?.components?.default;
}); });
@ -157,11 +166,43 @@ export default defineComponent({
: (matchCom.value as any)?.pageData, : (matchCom.value as any)?.pageData,
); );
const headers = computed(() => { const headers = computed(() => {
let tempHeaders = (pageData.value?.headers || []).filter((h: Header) => h.level === 2);
if (isDemo.value) { if (isDemo.value) {
return [...demos.value, { title: 'API', href: '#API' }]; tempHeaders = [...demos.value];
} else { if (isTablePage.value) {
return (pageData.value?.headers || []).filter((h: Header) => h.level === 2); tempHeaders.push(
...[
{
title: '大数据渲染',
enTitle: 'Virtualized Table',
href: 'https://surely.cool/doc/performance',
target: '_blank',
},
{
title: '行拖拽排序',
enTitle: 'Row Drag Sort',
href: 'https://surely.cool/doc/dragable#drag-row',
target: '_blank',
},
{
title: '列拖拽排序',
enTitle: 'Column Drag Sort',
href: 'https://surely.cool/doc/dragable#drag-column',
target: '_blank',
},
{
title: '更多高性能示例',
enTitle: 'More high-performance examples ',
href: 'https://surely.cool',
target: '_blank',
},
],
);
}
tempHeaders.push({ title: 'API', href: '#API' });
} }
return tempHeaders;
}); });
const mainContainerClass = computed(() => { const mainContainerClass = computed(() => {

View File

@ -35,7 +35,14 @@
<a-row :gutter="[24, 24]"> <a-row :gutter="[24, 24]">
<template v-for="component in group.children" :key="component.title"> <template v-for="component in group.children" :key="component.title">
<a-col :xs="24" :sm="12" :lg="8" :xl="6"> <a-col :xs="24" :sm="12" :lg="8" :xl="6">
<router-link :to="getLocalizedPathname(component.path, isZhCN)"> <component
:is="component.target ? 'a' : 'router-link'"
v-bind="
component.target
? { href: component.path, target: component.target }
: { to: getLocalizedPathname(component.path, isZhCN) }
"
>
<a-card size="small" class="components-overview-card"> <a-card size="small" class="components-overview-card">
<template #title> <template #title>
<div class="components-overview-title"> <div class="components-overview-title">
@ -47,7 +54,7 @@
<img :src="component.cover" :alt="component.title" /> <img :src="component.cover" :alt="component.title" />
</div> </div>
</a-card> </a-card>
</router-link> </component>
</a-col> </a-col>
</template> </template>
</a-row> </a-row>
@ -84,8 +91,28 @@ export default defineComponent({
); );
return { ...group, children: components }; return { ...group, children: components };
}) })
.filter(i => i.children.length); .filter(i => i.children.length)
.concat([
{
children: [
{
category: 'Components',
cols: 1,
cover: 'https://gw.alipayobjects.com/zos/alicdn/f-SbcX2Lx/Table.svg',
path: 'https://surely.cool/',
subtitle: '更强大的表格',
title: 'Powerful Table',
type: 'Advanced And Powerful',
target: '_blank',
},
],
enTitle: 'Advanced And Powerful',
title: '更强大',
order: 0,
},
]);
}); });
console.log(menuItems.value);
onMounted(() => { onMounted(() => {
inputRef.value.focus(); inputRef.value.focus();
}); });