docs: add element-ui link (#5776)

This commit is contained in:
三咲智子 2022-02-05 23:48:17 +08:00 committed by GitHub
parent dbb00ef4b6
commit 24ee8066e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 45 deletions

View File

@ -1,13 +0,0 @@
{
"links": "Links",
"repo": "GitHub",
"community": "Community",
"changelog": "Changelog",
"theme": "Online Theme Roller",
"faq": "FAQ",
"gitter": "Gitter",
"starter": "Starter kit",
"feedback": "Feedback",
"contribution": "Contribution",
"eleme": "Eleme"
}

View File

@ -1,7 +0,0 @@
{
"guide": "Guide",
"components": "Component",
"theme": "Theme",
"resource": "Resource",
"backToTop": "Back to top"
}

View File

@ -11,7 +11,7 @@
"10": "Links",
"11": "GitHub",
"12": "Changelog",
"13": "Starter kit",
"13": "Element UI for Vue 2",
"14": "Online Theme Roller",
"15": "Gitter",
"16": "Feedback",

View File

@ -1,6 +1,11 @@
<script setup lang="ts">
import { ref, reactive, computed } from 'vue'
import { useParallax, useThrottleFn, useEventListener } from '@vueuse/core'
import {
useParallax,
useThrottleFn,
useEventListener,
useIntervalFn,
} from '@vueuse/core'
import dayjs from 'dayjs'
import { useLang } from '../../composables/lang'
import homeLocale from '../../../i18n/pages/home.json'
@ -70,39 +75,40 @@ const handleScroll = useThrottleFn(() => {
useEventListener(window, 'scroll', handleScroll)
interface CountdownT {
days?: string
hours?: string
minutes?: string
seconds?: string
days: string
hours: string
minutes: string
seconds: string
}
const releaseDate = dayjs('2022-02-07T11:00:00.000+08:00')
const isBeforeRelease = ref(false)
const countDownText = ref<CountdownT>({})
const countdownText = ref<CountdownT>({} as CountdownT)
const calReleaseCountDown = () => {
if (dayjs().isBefore(releaseDate)) {
isBeforeRelease.value = true
const dayDiff = releaseDate.diff(dayjs(), 'day')
countDownText.value.days = String(dayDiff).padStart(2, '0')
countdownText.value.days = String(dayDiff).padStart(2, '0')
const hourDiff = releaseDate.diff(dayjs(), 'hour') - dayDiff * 24
countDownText.value.hours = String(hourDiff).padStart(2, '0')
countdownText.value.hours = String(hourDiff).padStart(2, '0')
const minuteDiff =
releaseDate.diff(dayjs(), 'minute') - hourDiff * 60 - dayDiff * 24 * 60
countDownText.value.minutes = String(minuteDiff).padStart(2, '0')
countdownText.value.minutes = String(minuteDiff).padStart(2, '0')
const secondDiff =
releaseDate.diff(dayjs(), 'second') -
minuteDiff * 60 -
hourDiff * 60 * 60 -
dayDiff * 24 * 60 * 60
countDownText.value.seconds = String(secondDiff).padStart(2, '0')
countdownText.value.seconds = String(secondDiff).padStart(2, '0')
} else {
clearInterval(intervalId)
pauseCountdown()
}
}
const intervalId = setInterval(() => {
calReleaseCountDown()
}, 1000)
calReleaseCountDown()
const { pause: pauseCountdown } = useIntervalFn(
() => calReleaseCountDown(),
1000,
{ immediateCallback: true }
)
</script>
<template>
@ -122,29 +128,29 @@ calReleaseCountDown()
<div class="cd-time">
<div class="cd-item">
<div class="cd-num">
<span>{{ countDownText.days[0] }}</span>
<span>{{ countDownText.days[1] }}</span>
<span>{{ countdownText.days[0] }}</span>
<span>{{ countdownText.days[1] }}</span>
</div>
<div class="cd-str">DAYS</div>
</div>
<div class="cd-item">
<div class="cd-num">
<span>{{ countDownText.hours[0] }}</span>
<span>{{ countDownText.hours[1] }}</span>
<span>{{ countdownText.hours[0] }}</span>
<span>{{ countdownText.hours[1] }}</span>
</div>
<div class="cd-str">HOURS</div>
</div>
<div class="cd-item">
<div class="cd-num">
<span>{{ countDownText.minutes[0] }}</span>
<span>{{ countDownText.minutes[1] }}</span>
<span>{{ countdownText.minutes[0] }}</span>
<span>{{ countdownText.minutes[1] }}</span>
</div>
<div class="cd-str">MINUTES</div>
</div>
<div class="cd-item">
<div class="cd-num">
<span>{{ countDownText.seconds[0] }}</span>
<span>{{ countDownText.seconds[1] }}</span>
<span>{{ countdownText.seconds[0] }}</span>
<span>{{ countdownText.seconds[1] }}</span>
</div>
<div class="cd-str">SECONDS</div>
</div>
@ -254,7 +260,7 @@ calReleaseCountDown()
{{ homeLang['12'] }}
</a>
<a
href="https://github.com/element-plus/element-plus-starter"
href="https://element.eleme.io/"
class="footer-main-link"
target="_blank"
>