Skip to content

Commit a31ef76

Browse files
committed
docs: update
1 parent 4de21a5 commit a31ef76

File tree

8 files changed

+323
-75
lines changed

8 files changed

+323
-75
lines changed

docs/.vitepress/config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function config () {
2424
metaChunk: true,
2525
title: 'KLineChart',
2626
outDir: '../website',
27-
srcExclude: ['@components', 'data', '@views'],
27+
srcExclude: ['@components', '@views', '@i18n'],
2828
lastUpdated: true,
2929
markdown: {
3030
theme: {

docs/@i18n/en-US.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"view_banner_tip": "🔔 v9 will be maintained until May 2025. It is recommended to migrate to the new version as soon as possible.",
3+
"view_customize_title": "Customized Service",
4+
"view_customize_free_title": "Free",
5+
"view_customize_free_desc": "Free professional K Line component",
6+
"view_customize_free_price": "$ 0",
7+
"view_customize_free_features": ["Highly scalable core chart", "Full features Pro version chart", "Complete development documents", "Development discussion WeChat group"],
8+
"view_customize_free_tip": "Contact the developer to join the development discussion group.",
9+
"view_customize_sponsor_title": "Sponsor",
10+
"view_customize_sponsor_desc": "Comprehensive answers to development issues",
11+
"view_customize_sponsor_sponsor": "Sponsor",
12+
"view_customize_sponsor_price": "$ 78",
13+
"view_customize_sponsor_features": ["All services in the free version", "Homepage sponsor advertising space", "One-on-one Q&A", "New features priority support"],
14+
"view_customize_sponsor_tip": "Donate to the project on the sponsorship page, and after completing the donation, contact the developer to get one week of answers to your questions.",
15+
"view_customize_custom_title": "Customized",
16+
"view_customize_custom_desc": "Exclusive customization and extended development",
17+
"view_customize_custom_price": "$ Discussion",
18+
"view_customize_custom_features": ["All services of the sponsored version", "UI custom development", "Extended custom development", "Other chart custom development"],
19+
"view_customize_custom_tip": "Contact developers to discuss specific requirements."
20+
}

docs/@i18n/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import zhCN from './zh-CN.json'
2+
import enUS from './en-US.json'
3+
4+
const locales = {
5+
'zh-CN': zhCN,
6+
'en-US': enUS
7+
}
8+
9+
export default function i18n (key, locale = 'zh-CN') {
10+
return (locales[locale] || {})[key] || key
11+
}

docs/@i18n/zh-CN.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"view_banner_tip": "🔔 v9 将维护到 2025 年 5 月份,建议尽快迁移到新版本。",
3+
"view_customize_title": "定制化服务",
4+
"view_customize_free_title": "免费版",
5+
"view_customize_free_desc": "免费的专业级K线组件",
6+
"view_customize_free_price": "¥ 0",
7+
"view_customize_free_features": ["高度可扩展的核心图表", "功能完善的Pro版图表", "完善的开发文档", "开发讨论微信群"],
8+
"view_customize_free_tip": "联系开发者加入开发讨论群。",
9+
"view_customize_sponsor_title": "赞助版",
10+
"view_customize_sponsor_desc": "全方位解答遇到的问题",
11+
"view_customize_sponsor_sponsor": "赞助",
12+
"view_customize_sponsor_price": "¥ 500",
13+
"view_customize_sponsor_features": ["免费版所有服务", "首页赞助商广告位", "一对一答疑", "新功能优先支持"],
14+
"view_customize_sponsor_tip": "在赞助页对项目进行捐赠,完成之后联系开发者获得一周时间的答疑。",
15+
"view_customize_custom_title": "定制版",
16+
"view_customize_custom_desc": "专属定制,扩展开发",
17+
"view_customize_custom_price": "¥ 面议",
18+
"view_customize_custom_features": ["赞助版所有服务", "UI定制开发", "扩展定制开发", "其它图表相关定制开发"],
19+
"view_customize_custom_tip": "联系开发者,讨论具体需求。"
20+
}

docs/@views/Banner.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
2-
<div class="banner" :class="{ 'top': y === 0 }" role="banner" v-if="isVisible">
3-
<span v-if="lang === 'zh-CN'">🔔&nbsp;&nbsp;v9 将维护到 2025 年 5 月份,建议尽快迁移到新版本。</span>
4-
<span v-else>🔔&nbsp;&nbsp;v9 will be maintained until May 2025. It is recommended to migrate to the new version as soon as possible.</span>
2+
<div class="banner" :class="{ 'top': y === 0 }" role="banner" v-if="visible">
3+
<span>{{ i18n('view_banner_tip', lang) }}</span>
54
<button class="banner-close" @click.prevent="closeBanner">
65
<span class="close">&times;</span>
76
</button>
@@ -13,21 +12,22 @@ import { ref, onMounted } from 'vue'
1312
import { useWindowScroll } from '@vueuse/core'
1413
import { useData } from 'vitepress'
1514
15+
import i18n from '../@i18n'
16+
1617
const { y } = useWindowScroll()
1718
18-
const isVisible = ref(true)
19+
const visible = ref(false)
1920
2021
const { lang } = useData()
2122
2223
const closeBanner = () => {
23-
isVisible.value = false
24+
visible.value = false
2425
document.documentElement.classList.remove('banner-fixed')
2526
}
2627
2728
onMounted(() => {
28-
if (isVisible.value) {
29-
document.documentElement.classList.add('banner-fixed')
30-
}
29+
visible.value = true
30+
document.documentElement.classList.add('banner-fixed')
3131
})
3232
</script>
3333
<style scoped>
@@ -45,7 +45,7 @@ onMounted(() => {
4545
right: 0;
4646
z-index: 61;
4747
width: 100%;
48-
height: var(--vp-layout-top-height);
48+
height: var(--vp-layout-top-height, 50px);
4949
background-color: var(--vp-c-bg);
5050
overflow: hidden;
5151
margin: 0;

docs/@views/customize/index.vue

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
<template>
22
<div class="customize">
3-
<h1 class="customize-title">{{ lang === 'zh-CN' ? '定制化服务' : 'Customized Service' }}</h1>
3+
<h1 class="customize-title">{{i18n('view_customize_title', lang)}}</h1>
44
<div class="customize-content">
55
<div class="customize-content-item customize-content-free-item">
66
<div class="customize-content-item-title-container">
7-
<h3 class="customize-content-item-title">{{ lang === 'zh-CN' ? '免费版' : 'Free' }}</h3>
8-
<p class="customize-content-item-sub-title">{{ lang === 'zh-CN' ? '免费的专业级K线组件' : 'Free professional K Line component' }}</p>
7+
<h3 class="customize-content-item-title">{{i18n('view_customize_free_title', lang)}}</h3>
8+
<p class="customize-content-item-sub-title">{{i18n('view_customize_free_desc', lang)}}</p>
99
<p class="customize-content-item-price">
10-
{{ lang === 'zh-CN' ? '¥ 0' : '$ 0' }}
10+
{{i18n('view_customize_free_price', lang)}}
1111
</p>
1212
</div>
13-
<FeatureList :features="lang === 'zh-CN' ? ['高度可扩展的核心图表', '功能完善的Pro版图表', '完善的开发文档', '开发讨论微信群'] : ['Highly scalable core chart', 'Full features Pro version chart', 'Complete development documents', 'Development discussion WeChat group']"/>
13+
<FeatureList :features="i18n('view_customize_free_features', lang)"/>
1414
<p class="customize-content-item-tip">
15-
{{ lang === 'zh-CN' ? '联系开发者加入开发讨论群。' : 'Contact the developer to join the development discussion group.' }}
15+
{{i18n('view_customize_free_tip', lang)}}
1616
</p>
1717
</div>
1818
<div class="customize-content-item customize-content-qa-item">
1919
<div class="customize-content-item-title-container">
20-
<h3 class="customize-content-item-title">{{ lang === 'zh-CN' ? '赞助版' : 'Sponsor' }}</h3>
21-
<p class="customize-content-item-sub-title">{{ lang === 'zh-CN' ? '全方位解答遇到的问题' : 'Comprehensive answers to development issues' }}</p>
20+
<h3 class="customize-content-item-title">{{i18n('view_customize_sponsor_title', lang)}}</h3>
21+
<p class="customize-content-item-sub-title">{{i18n('view_customize_sponsor_desc', lang)}}</p>
2222
<p class="customize-content-item-price">
23-
<span style="font-size: 14px; padding-right: 6px; padding-top: 4px; font-weight: normal;">{{ lang === 'zh-CN' ? '赞助' : 'Sponsor' }}</span>{{ lang === 'zh-CN' ? `¥ 500` : '$ 78' }}
23+
<span style="font-size: 14px; padding-right: 6px; padding-top: 4px; font-weight: normal;">{{i18n('view_customize_sponsor_sponsor', lang)}}</span>
24+
{{i18n('view_customize_sponsor_price', lang)}}
2425
</p>
2526
</div>
2627

27-
<FeatureList :features="lang === 'zh-CN' ? ['免费版所有服务', '首页赞助商广告位', '一对一答疑', '新功能优先支持'] : ['All services in the free version', 'Homepage sponsor advertising space', 'One-on-one Q&A', 'New features priority support']"/>
28+
<FeatureList :features="i18n('view_customize_sponsor_features', lang)"/>
2829
<p class="customize-content-item-tip">
29-
{{ lang === 'zh-CN' ? '在赞助页对项目进行捐赠,完成之后联系开发者获得一周时间的答疑。' : 'Donate to the project on the sponsorship page, and after completing the donation, contact the developer to get one week of answers to your questions.' }}
30+
{{i18n('view_customize_sponsor_tip', lang)}}
3031
</p>
3132
</div>
3233
<div class="customize-content-item customize-content-custom-item">
3334
<div class="customize-content-item-title-container">
34-
<h3 class="customize-content-item-title">{{ lang === 'zh-CN' ? '定制版' : 'Customized' }}</h3>
35-
<p class="customize-content-item-sub-title">{{ lang === 'zh-CN' ? '专属定制,扩展开发' : 'Exclusive customization and extended development' }}</p>
35+
<h3 class="customize-content-item-title">{{i18n('view_customize_custom_title', lang)}}</h3>
36+
<p class="customize-content-item-sub-title">{{i18n('view_customize_custom_desc', lang)}}</p>
3637
<p class="customize-content-item-price">
37-
{{ lang === 'zh-CN' ? '¥ 面议' : '$ Discussion' }}
38+
{{i18n('view_customize_custom_price', lang)}}
3839
</p>
3940
</div>
40-
<FeatureList :features="lang === 'zh-CN' ? ['赞助版所有服务', 'UI定制开发', '扩展定制开发', '其它图表相关定制开发'] : ['All services of the sponsored version', 'UI custom development', 'Extended custom development', 'Other chart custom development']"/>
41+
<FeatureList :features="i18n('view_customize_custom_features', lang)"/>
4142
<p class="customize-content-item-tip">
42-
{{ lang === 'zh-CN' ? '联系开发者,讨论具体需求。' : 'Contact developers to discuss specific requirements.' }}
43+
{{i18n('view_customize_custom_tip', lang)}}
4344
</p>
4445
</div>
4546
</div>
@@ -49,6 +50,8 @@
4950
<script setup>
5051
import { useData } from 'vitepress'
5152
53+
import i18n from '../../@i18n'
54+
5255
import FeatureList from './FeatureList.vue'
5356
5457
const { lang } = useData()
@@ -183,6 +186,7 @@ const { lang } = useData()
183186
font-size: 14px;
184187
padding: 0 20px;
185188
color: #e77c0a;
189+
line-height: 18px;
186190
border-top: solid 1px var(--vp-c-gutter);
187191
}
188192

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"shiki": "^2.4.2",
108108
"tslib": "^2.8.1",
109109
"typescript": "^5.8.3",
110-
"vitepress": "2.0.0-alpha.5"
110+
"vitepress": "2.0.0-alpha.6"
111111
},
112112
"pnpm": {
113113
"overrides": {

0 commit comments

Comments
 (0)