From 1393bde516f6756e70d88e74f8f3ce30847f92d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 15 Jun 2021 16:46:45 +0200 Subject: [PATCH] docs(nuxtjs): Update home hero (#432) * docs(nuxtjs): Update home hero * fix: use onMounted for listening on mousemove * docs: update number of stars --- nuxtjs.org/components/AButton.vue | 14 +-- nuxtjs.org/components/HeroDescription.vue | 5 -- nuxtjs.org/components/HeroParallax.vue | 4 +- nuxtjs.org/components/HeroTemplate.vue | 4 +- nuxtjs.org/components/HeroTitle.vue | 20 ----- nuxtjs.org/components/HomeHero.vue | 104 ++++++++++++++-------- nuxtjs.org/components/SectionButton.vue | 7 +- nuxtjs.org/content/index.md | 12 +++ 8 files changed, 91 insertions(+), 79 deletions(-) delete mode 100644 nuxtjs.org/components/HeroDescription.vue delete mode 100644 nuxtjs.org/components/HeroTitle.vue diff --git a/nuxtjs.org/components/AButton.vue b/nuxtjs.org/components/AButton.vue index 9ca36d0b7..ac405017a 100644 --- a/nuxtjs.org/components/AButton.vue +++ b/nuxtjs.org/components/AButton.vue @@ -28,10 +28,6 @@ import { defineComponent, ref } from '@vue/composition-api' export default defineComponent({ props: { - href: { - type: String, - default: null - }, to: { type: [String, Object], default: null @@ -94,7 +90,7 @@ export default defineComponent({ props() { return { a: { - href: this.href, + href: this.to, target: this.target, rel: this.rel, ariaLabel: this.ariaLabel @@ -111,8 +107,14 @@ export default defineComponent({ } }[this.is] }, + isExternal() { + if (!this.to) return false + const isInternal = typeof this.to !== 'string' || (this.to.startsWith('/') && this.to.startsWith('//') === false) + + return !isInternal + }, is() { - if (this.href) { + if (this.isExternal) { return 'a' } else if (this.to) { return 'NuxtLink' diff --git a/nuxtjs.org/components/HeroDescription.vue b/nuxtjs.org/components/HeroDescription.vue deleted file mode 100644 index 75e9288b8..000000000 --- a/nuxtjs.org/components/HeroDescription.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/nuxtjs.org/components/HeroParallax.vue b/nuxtjs.org/components/HeroParallax.vue index e9cb81e10..bbe325ea4 100644 --- a/nuxtjs.org/components/HeroParallax.vue +++ b/nuxtjs.org/components/HeroParallax.vue @@ -52,7 +52,7 @@ diff --git a/nuxtjs.org/components/HomeHero.vue b/nuxtjs.org/components/HomeHero.vue index 10c437f03..7a4846239 100644 --- a/nuxtjs.org/components/HomeHero.vue +++ b/nuxtjs.org/components/HomeHero.vue @@ -1,41 +1,69 @@ + + diff --git a/nuxtjs.org/components/SectionButton.vue b/nuxtjs.org/components/SectionButton.vue index 04bc28bc7..2c07d2b14 100644 --- a/nuxtjs.org/components/SectionButton.vue +++ b/nuxtjs.org/components/SectionButton.vue @@ -2,7 +2,6 @@