forked from vuejs/router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Vue School banner to show Vue.js Forge offer (vuejs#1537)
- Loading branch information
Showing
7 changed files
with
205 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
packages/docs/.vitepress/components/VueSchool/BannerCountdownMobile.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<ClientOnly> | ||
<VueCountdown | ||
v-if="remaining" | ||
:time="remaining" | ||
v-slot="data" | ||
class="vs-countdown-mobile-wrapper"> | ||
<span | ||
v-for="part in ['days', 'hours', 'minutes', 'seconds']" | ||
:key="part"> | ||
{{ data[part] }}{{ part[0].toLowerCase() }} | ||
<span | ||
v-if="part !== 'seconds'"> | ||
: | ||
</span> | ||
</span> | ||
</VueCountdown> | ||
</ClientOnly> | ||
</template> | ||
|
||
<script> | ||
import VueCountdown from '@chenfengyuan/vue-countdown' | ||
const countdownTransform = (props) => { | ||
Object.entries(props).forEach(([key, value]) => { | ||
const digits = value < 10 ? `0${value}` : value | ||
props[key] = digits | ||
}) | ||
return props | ||
} | ||
export default { | ||
components: { | ||
VueCountdown | ||
}, | ||
props: { | ||
remaining: { | ||
type: Number, | ||
default: 0 | ||
} | ||
}, | ||
computed: { | ||
isVisible () { | ||
return this.remaining > 0 | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.vs-countdown-mobile-wrapper { | ||
display: block; | ||
color: #40f98a; | ||
text-align: center; | ||
font-weight: bold; | ||
font-size: 12px; | ||
} | ||
@media (min-width: 680px) { | ||
.vs-countdown-mobile-wrapper { | ||
display: none; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.