Skip to content

Commit

Permalink
fix(cli/site): support custom description
Browse files Browse the repository at this point in the history
  • Loading branch information
qytayh committed Jul 1, 2022
1 parent 70e7b51 commit d1b243e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/varlet-cli/site/pc/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ const darkMode: Ref<boolean> = ref(get(config, 'pc.header.darkMode'))
const title: Ref<string> = ref(get(config, 'title'))
const languages: Ref<Record<string, string>> = ref(get(config, 'pc.header.i18n'))
const pack: Ref<Record<string, string>> = ref({})
const description:Ref<string> = ref('')
const goGithub = () => {
window.open(github)
}
const getStar = () => {
const { language: lang } = getPCLocationInfo()
router.push(`/${lang}/home`)
}
Expand All @@ -54,6 +56,7 @@ const setLocale = () => {
const { language: lang } = getPCLocationInfo()
if (!lang) return
description.value = get(config, 'pc.description')[lang] as string
pack.value = packs[lang]
document.title = get(config, 'pc.title')[lang] as string
}
Expand Down Expand Up @@ -90,7 +93,7 @@ watch(() => route.path, setLocale, { immediate: true })
<animation-box class="logo" />
<div class="base-title">{{ title }}</div>
</div>
<div class="base-description">{{ pack.description }}</div>
<div class="base-description">{{ description }}</div>

<div class="button-group">
<var-site-button class="common-button github-button" block @click="goGithub">
Expand Down
4 changes: 1 addition & 3 deletions packages/varlet-cli/site/pc/pages/index/locale/en-US.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export default {
started: 'GET STARTED',
description: 'Varlet is a Material design mobile component library developed based on Vue3, developed and maintained by partners in the community. ' +
'Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience',
started: 'GET STARTED'
}
4 changes: 1 addition & 3 deletions packages/varlet-cli/site/pc/pages/index/locale/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export default {
started: '起步',
description: 'Varlet 是一个基于 Vue3 开发的 Material 风格移动端组件库,' +
'全面拥抱 Vue3 生态,由社区团队维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件保障良好的开发体验',
started: '起步'
}
6 changes: 6 additions & 0 deletions packages/varlet-cli/varlet.default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ module.exports = {
playground: 'https://varlet-ui-playground.vercel.app',
darkMode: true,
},
description: {
'zh-CN':
'Varlet 是一个基于 Vue3 开发的 Material 风格移动端组件库,全面拥抱 Vue3 生态,由社区团队维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件保障良好的开发体验',
'en-US':
'Varlet is a Material design mobile component library developed based on Vue3, developed and maintained by partners in the community. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience',
},
clipboard: {
'zh-CN': '代码已复制到剪切板',
'en-US': 'The code has been copied to the clipboard',
Expand Down

0 comments on commit d1b243e

Please sign in to comment.