generated from cms/tibi-docs
frontend session
This commit is contained in:
24
frontend/src/lib/components/widgets/image.svelte
Normal file
24
frontend/src/lib/components/widgets/image.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
import { apiBaseURL } from "../../../config"
|
||||
export let image: FileField
|
||||
export let pageId: string
|
||||
</script>
|
||||
|
||||
<div class="image-container">
|
||||
<img src="{`${apiBaseURL}page/${pageId}/${image?.src}`}" alt="img" />
|
||||
</div>
|
||||
|
||||
<style lang="less">
|
||||
.image-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
object-fit: contain;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user