-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a component to display a loading spinner and an optional loading message. Signed-off-by: Eva Millán <[email protected]>
- Loading branch information
1 parent
51f29eb
commit b83dc3c
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import LoadingSpinner from "./LoadingSpinner.vue"; | ||
|
||
export default { | ||
title: "LoadingSpinner", | ||
excludeStories: /.*Data$/, | ||
}; | ||
|
||
const template = `<loading-spinner :label="label"/>`; | ||
|
||
export const Default = () => ({ | ||
components: { LoadingSpinner }, | ||
template: template, | ||
data: () => ({ | ||
label: null, | ||
}), | ||
}); | ||
|
||
export const Label = () => ({ | ||
components: { LoadingSpinner }, | ||
template: template, | ||
data: () => ({ | ||
label: "Loading...", | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div class="d-flex flex-column justify-center align-center pa-4 h-100"> | ||
<v-progress-circular :size="size" color="primary" indeterminate /> | ||
<p v-if="label" class="subtitle-1 text-medium-emphasis mt-4">{{ label }}</p> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
name: "LoadingSpinner", | ||
props: { | ||
label: { | ||
type: String, | ||
required: false, | ||
default: null, | ||
}, | ||
size: { | ||
type: [String, Number], | ||
required: false, | ||
default: 48, | ||
}, | ||
}, | ||
}; | ||
</script> |