This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
893747a
commit 7c3f866
Showing
5 changed files
with
158 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
import Vue from "vue"; | ||
import HomeFeatures from "@theme/components/HomeFeatures.vue"; | ||
import HomeHero from "@theme/components/HomeHero.vue"; | ||
import MyTransition from "@theme/components/MyTransition.vue"; | ||
import { navigate } from "@theme/utils/navigate"; | ||
|
||
interface ActionConfig { | ||
text: string; | ||
link: string; | ||
} | ||
|
||
export default Vue.extend({ | ||
name: "Home", | ||
|
||
components: { HomeHero, MyTransition }, | ||
|
||
computed: { | ||
actionLinks(): ActionConfig[] { | ||
const { action } = this.$frontmatter; | ||
|
||
if (Array.isArray(action)) return action as ActionConfig[]; | ||
|
||
return [action] as ActionConfig[]; | ||
}, | ||
}, | ||
|
||
methods: { | ||
navigate(link: string): void { | ||
navigate(link, this.$router, this.$route); | ||
}, | ||
}, | ||
components: { HomeFeatures, HomeHero, MyTransition }, | ||
}); |
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
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,19 @@ | ||
import Vue from "vue"; | ||
import { navigate } from "@theme/utils/navigate"; | ||
|
||
export default Vue.extend({ | ||
name: "HomeFeatures", | ||
|
||
methods: { | ||
getIconType(icon = ""): string { | ||
return icon.match(/(?:https?:)?\/\//) | ||
? "link" | ||
: icon.startsWith("/") | ||
? "path" | ||
: "class"; | ||
}, | ||
navigate(link: string): void { | ||
navigate(link, this.$router, this.$route); | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.