feat: placeholder component in hoppscotch-ui (#3123)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Anwarul Islam
2023-06-21 00:39:16 +06:00
committed by GitHub
parent 331d482b22
commit fc3e3aeaec
43 changed files with 378 additions and 577 deletions

View File

@@ -0,0 +1,40 @@
<template>
<div class="flex flex-col items-center justify-center p-4">
<img
v-if="src"
:src="src"
loading="lazy"
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
:alt="alt"
/>
<slot name="icon"></slot>
<span v-if="heading" class="mb-2 font-semibold text-center">
{{ heading }}
</span>
<span
class="max-w-sm mb-4 text-center whitespace-normal text-secondaryLight"
>
{{ text }}
</span>
<slot></slot>
</div>
</template>
<script setup lang="ts">
withDefaults(
defineProps<{
src?: string
alt?: string
heading?: string
text?: string
}>(),
{
alt: "",
text: "",
}
)
</script>

View File

@@ -19,3 +19,4 @@ export { default as HoppSmartToggle } from "./Toggle.vue"
export { default as HoppSmartWindow } from "./Window.vue"
export { default as HoppSmartWindows } from "./Windows.vue"
export { default as HoppSmartPicture } from "./Picture.vue"
export { default as HoppSmartPlaceholder } from "./Placeholder.vue"