mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
style button loading state
This commit is contained in:
parent
69a69ad0c9
commit
93233a5c76
@ -1,13 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<button :class="buttonClass" :disabled="loading">
|
<button :class="buttonClass" :disabled="loading">
|
||||||
<ds-spinner size="small" v-if="loading" />
|
<loading-spinner v-if="loading" />
|
||||||
<base-icon v-if="icon" :name="icon" />
|
<base-icon v-if="icon" :name="icon" />
|
||||||
<slot />
|
<slot />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import LoadingSpinner from '~/components/_new/generic/LoadingSpinner/LoadingSpinner'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
LoadingSpinner,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
circle: {
|
circle: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -35,6 +40,7 @@ export default {
|
|||||||
|
|
||||||
if (this.$slots.default == null) buttonClass += ' --icon-only'
|
if (this.$slots.default == null) buttonClass += ' --icon-only'
|
||||||
if (this.circle) buttonClass += ' --circle'
|
if (this.circle) buttonClass += ' --circle'
|
||||||
|
if (this.loading) buttonClass += ' --loading'
|
||||||
if (this.primary) buttonClass += ' --primary'
|
if (this.primary) buttonClass += ' --primary'
|
||||||
else if (this.danger) buttonClass += ' --danger'
|
else if (this.danger) buttonClass += ' --danger'
|
||||||
|
|
||||||
@ -51,6 +57,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
|
vertical-align: bottom;
|
||||||
color: $color-primary;
|
color: $color-primary;
|
||||||
background-color: $color-neutral-90;
|
background-color: $color-neutral-90;
|
||||||
border: 1px solid $color-primary;
|
border: 1px solid $color-primary;
|
||||||
@ -126,5 +133,20 @@ export default {
|
|||||||
&:not(.--icon-only) > .base-icon {
|
&:not(.--icon-only) > .base-icon {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .loading-spinner {
|
||||||
|
position: absolute;
|
||||||
|
height: 26px;
|
||||||
|
color: $color-neutral-60;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.--loading {
|
||||||
|
color: $color-neutral-80;
|
||||||
|
|
||||||
|
&.--primary > .loading-spinner,
|
||||||
|
&.--danger > .loading-spinner {
|
||||||
|
color: $color-neutral-100;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -37,6 +37,7 @@ export default {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.base-icon {
|
.base-icon {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
vertical-align: bottom;
|
||||||
|
|
||||||
> .svg {
|
> .svg {
|
||||||
height: 1.2em;
|
height: 1.2em;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user