Add card to display errors that scrolls into view.
This commit is contained in:
parent
4ed749eee3
commit
5a944f9916
2 changed files with 53 additions and 0 deletions
frontend/src/components
37
frontend/src/components/ErrorCard.vue
Normal file
37
frontend/src/components/ErrorCard.vue
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue