2022-03-26 15:45:25 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue'
|
2022-07-19 20:41:22 +08:00
|
|
|
import { isClient } from '@vueuse/core'
|
2022-03-26 15:45:25 +08:00
|
|
|
import { useLang } from '../../composables/lang'
|
|
|
|
import resourceLocale from '../../../i18n/pages/resource.json'
|
2022-05-30 23:39:05 +08:00
|
|
|
import { sendEvent } from '../../../config/analytics'
|
2023-11-24 08:48:11 +08:00
|
|
|
|
|
|
|
import AxureComponentsSvg from './resources/axure-components-svg.vue'
|
|
|
|
import SketchTemplateSvg from './resources/sketch-template-svg.vue'
|
|
|
|
import FigmaTemplateSvg from './resources/figma-template-svg.vue'
|
|
|
|
import FigmaVariablesSvg from './resources/figma-variables-svg.vue'
|
|
|
|
import FigmaUiKitSvg from './resources/figma-ui-kit-svg.vue'
|
|
|
|
|
2022-07-19 20:41:22 +08:00
|
|
|
const mirrorUrl = 'element-plus.gitee.io'
|
|
|
|
const isMirrorUrl = () => {
|
|
|
|
if (!isClient) return
|
|
|
|
return window.location.hostname === mirrorUrl
|
|
|
|
}
|
|
|
|
const resourceUrl = {
|
|
|
|
github: {
|
|
|
|
sketch:
|
|
|
|
'https://github.com/ElementUI/Resources/raw/master/Element_Plus_Design_System_2022_1.0_Beta.zip',
|
|
|
|
axure:
|
|
|
|
'https://github.com/ElementUI/Resources/raw/master/Element_Components_v2.1.0.rplib',
|
|
|
|
},
|
|
|
|
gitee: {
|
|
|
|
sketch:
|
|
|
|
'https://gitee.com/element-plus/resources/raw/master/Element_Plus_Design_System_2022_1.0_Beta.zip',
|
|
|
|
axure:
|
|
|
|
'https://gitee.com/element-plus/resources/raw/master/Element_Components_v2.1.0.rplib',
|
|
|
|
},
|
|
|
|
}[isMirrorUrl() ? 'gitee' : 'github']
|
|
|
|
|
2022-03-26 15:45:25 +08:00
|
|
|
const lang = useLang()
|
|
|
|
const resourceLang = computed(() => resourceLocale[lang.value])
|
2022-05-30 23:39:05 +08:00
|
|
|
const onClick = (item: string) => {
|
|
|
|
sendEvent('resource_download', item)
|
|
|
|
}
|
2023-11-24 08:48:11 +08:00
|
|
|
|
|
|
|
const resourceCards = computed(() => [
|
|
|
|
{
|
|
|
|
key: 'axure',
|
|
|
|
title: resourceLang.value.axure,
|
|
|
|
description: 'Axure RP 9.0',
|
|
|
|
icon: AxureComponentsSvg,
|
|
|
|
intro: resourceLang.value.axureIntro,
|
|
|
|
url: resourceUrl.axure,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'sketch',
|
|
|
|
title: resourceLang.value.sketch,
|
|
|
|
description: 'Sketch 70.6',
|
|
|
|
icon: SketchTemplateSvg,
|
|
|
|
intro: resourceLang.value.sketchIntro,
|
|
|
|
url: resourceUrl.sketch,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'figma',
|
|
|
|
title: resourceLang.value.figma,
|
|
|
|
icon: FigmaTemplateSvg,
|
|
|
|
intro: resourceLang.value.figmaIntro,
|
|
|
|
url: 'https://www.figma.com/community/file/1021254029764378306',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'figma-variables',
|
|
|
|
title: resourceLang.value.figmaVariables,
|
|
|
|
icon: FigmaVariablesSvg,
|
|
|
|
intro: resourceLang.value.figmaVariablesIntro,
|
|
|
|
url: 'https://www.figma.com/community/file/1256091634199852065',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: '2023-figma-ui-kit',
|
|
|
|
title: resourceLang.value.figma2023,
|
|
|
|
description: '2023 Figma UI Kit',
|
|
|
|
icon: FigmaUiKitSvg,
|
|
|
|
intro: resourceLang.value.figma2023Intro,
|
|
|
|
url: 'https://www.figma.com/community/file/1305760370797950824/element-plus-design-system-ui-kit',
|
|
|
|
},
|
|
|
|
])
|
2022-03-26 15:45:25 +08:00
|
|
|
</script>
|
|
|
|
|
2022-02-24 11:04:56 +08:00
|
|
|
<template>
|
|
|
|
<div class="page-resource">
|
2022-03-26 15:45:25 +08:00
|
|
|
<h1>{{ resourceLang.title }}</h1>
|
|
|
|
<p>{{ resourceLang.lineOne }}</p>
|
2022-05-28 04:34:39 +08:00
|
|
|
<p v-html="resourceLang.lineTwo" />
|
2023-08-03 16:55:02 +08:00
|
|
|
<div class="flex flex-wrap justify-center mt-32px" m="-2">
|
2023-11-24 08:48:11 +08:00
|
|
|
<div
|
|
|
|
v-for="card in resourceCards"
|
|
|
|
:key="card.title"
|
|
|
|
class="inline-flex w-full md:w-1/2 lg:w-1/3 3xl:w-1/4"
|
|
|
|
p="2"
|
|
|
|
>
|
2023-08-03 16:55:02 +08:00
|
|
|
<el-card class="card" shadow="hover">
|
2023-11-24 08:48:11 +08:00
|
|
|
<div class="w-30 m-auto">
|
|
|
|
<component :is="card.icon" alt="icon" />
|
|
|
|
</div>
|
|
|
|
<h3>{{ card.title }}</h3>
|
2023-08-03 16:55:02 +08:00
|
|
|
<p>
|
2023-11-24 08:48:11 +08:00
|
|
|
{{ card.intro }}
|
2023-08-03 16:55:02 +08:00
|
|
|
</p>
|
2023-11-24 08:48:11 +08:00
|
|
|
<a target="_blank" :href="card.url" @click="onClick(card.title)">
|
2023-08-03 16:55:02 +08:00
|
|
|
<el-button type="primary">{{ resourceLang.download }}</el-button>
|
|
|
|
</a>
|
|
|
|
</el-card>
|
|
|
|
</div>
|
2022-04-27 10:47:15 +08:00
|
|
|
</div>
|
2022-02-24 11:04:56 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.page-resource {
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 0 40px;
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
color: var(--text-color);
|
2022-05-28 04:34:39 +08:00
|
|
|
margin-bottom: 24px;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
color: var(--text-color-light);
|
|
|
|
line-height: 24px;
|
|
|
|
margin: 0;
|
|
|
|
&:last-of-type {
|
|
|
|
margin-top: 8px;
|
2022-02-24 11:04:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.card {
|
2023-08-03 16:55:02 +08:00
|
|
|
width: 100%;
|
2022-02-24 11:04:56 +08:00
|
|
|
text-align: center;
|
|
|
|
padding: 32px 0;
|
|
|
|
|
|
|
|
img {
|
|
|
|
margin: auto;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
height: 87px;
|
|
|
|
}
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
margin: 10px;
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
|
|
|
font-size: 14px;
|
|
|
|
color: #99a9bf;
|
|
|
|
padding: 0 30px;
|
|
|
|
margin: 0;
|
2023-12-21 15:21:12 +08:00
|
|
|
overflow-wrap: break-word;
|
2022-02-24 11:04:56 +08:00
|
|
|
line-height: 1.8;
|
|
|
|
min-height: 75px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|