mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Convert Heading component to use typescript
This commit is contained in:
committed by
Dannon Baker
parent
e4ba07ac7e
commit
041e47b4bc
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import type { PropType } from "vue";
|
||||
|
||||
let element = "h1";
|
||||
let sizeClass = "h-lg";
|
||||
@@ -14,14 +15,13 @@ const props = defineProps({
|
||||
bold: Boolean,
|
||||
separator: Boolean,
|
||||
inline: Boolean,
|
||||
// acceptable sizes are "xl", "lg", "md", "sm", and "text"
|
||||
size: String,
|
||||
size: String as PropType<"xl" | "lg" | "md" | "sm" | "text">,
|
||||
icon: String,
|
||||
});
|
||||
|
||||
// apply heading element
|
||||
for (const key of ["h1", "h2", "h3", "h4", "h5", "h6"]) {
|
||||
if (props[key]) {
|
||||
if (props[key as keyof typeof props.size]) {
|
||||
element = key;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ const greenAlgorithmsUrl = "https://www.green-algorithms.org/";
|
||||
<template>
|
||||
<article class="mt-4">
|
||||
<header>
|
||||
<Heading h1 separator bold size="h-lg">Carbon Emissions Calculations</Heading>
|
||||
<Heading h1 separator bold size="lg">Carbon Emissions Calculations</Heading>
|
||||
|
||||
<p>
|
||||
Our calculations are based off of the work of the
|
||||
|
||||
Reference in New Issue
Block a user