Add card to display errors that scrolls into view.

This commit is contained in:
baldo 2022-08-23 15:41:01 +02:00
parent 4ed749eee3
commit 5a944f9916
2 changed files with 53 additions and 0 deletions
frontend/src/components

View file

@ -0,0 +1,37 @@
<script setup lang="ts">
import {onMounted, ref} from "vue";
const element = ref<HTMLElement>();
function scrollIntoView() {
element.value?.scrollIntoView({
behavior: "smooth",
block: "nearest"
});
}
onMounted(scrollIntoView);
</script>
<template>
<div ref="element" class="error-card">
<slot></slot>
</div>
</template>
<style lang="scss">
@import "../scss/variables";
.error-card {
margin: $error-card-margin;
padding: $error-card-padding;
border: $error-card-border;
border-radius: $error-card-border-radius;
font-weight: $error-card-font-weight;
background-color: $error-card-background-color;
color: $error-card-color;
}
</style>