Re-add spinner to button.
This commit is contained in:
parent
ac416db4d8
commit
6edc1222a5
4 changed files with 135 additions and 15905 deletions
15979
package-lock.json
generated
15979
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,6 +9,7 @@
|
||||||
"test:unit": "vue-cli-service test:unit --coverage --coverageReporters=cobertura --coverageReporters=html --ci --watchAll=false --reporters=jest-junit --reporters=default"
|
"test:unit": "vue-cli-service test:unit --coverage --coverageReporters=cobertura --coverageReporters=html --ci --watchAll=false --reporters=jest-junit --reporters=default"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@popperjs/core": "^2.10.2",
|
||||||
"axios": "^0.23.0",
|
"axios": "^0.23.0",
|
||||||
"bootstrap": "^5.1.1",
|
"bootstrap": "^5.1.1",
|
||||||
"canvas-confetti": "^1.4.0",
|
"canvas-confetti": "^1.4.0",
|
||||||
|
|
|
||||||
15
src/App.vue
15
src/App.vue
|
|
@ -19,17 +19,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimary buttonText="Primary" buttonType="btn-primary" />
|
<buttonPrimary
|
||||||
|
buttonText="Primary"
|
||||||
|
buttonType="btn-primary"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimary buttonText="Primary Focus" buttonType="btn-primary-focus" />
|
<buttonPrimary
|
||||||
|
buttonText="Primary Focus"
|
||||||
|
buttonType="btn-primary-focus"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimary buttonText="Disabled" buttonType="disabled" />
|
<buttonPrimary
|
||||||
|
buttonText="Disabled"
|
||||||
|
buttonType="disabled"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<button type="button" class="btn" v-bind:class="[(this.buttonType === 'btn-funnel' ? ['btn-funnel', 'border', 'rounded', 'w-100', 'text-start'] : this.buttonType)]" v-on:click="this.buttonType === 'btn-funnel' ? showLoader() : null">
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn d-flex align-items-center"
|
||||||
|
v-on:click="showLoader()"
|
||||||
|
v-bind:class="[(this.isLoading ? 'button-loader' : 'not-loading'),this.buttonType]"
|
||||||
|
>
|
||||||
{{ this.buttonText }}
|
{{ this.buttonText }}
|
||||||
|
</button>
|
||||||
<!-- Spinner for funnel Button -->
|
|
||||||
<div v-if="this.buttonType === 'btn-funnel' && this.isLoading" class="spinner-border spinner-border-sm text-success" role="status">
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</button>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'button',
|
name: 'buttonPrimary',
|
||||||
props: {
|
props: {
|
||||||
buttonText: String,
|
buttonText: String,
|
||||||
buttonType: String
|
buttonType: String
|
||||||
},
|
},
|
||||||
data() {
|
data(){
|
||||||
return {
|
return {
|
||||||
isLoading: false
|
isLoading: false
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showLoader() {
|
|
||||||
this.isLoading = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLoader(){
|
||||||
|
this.isLoading = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in a new issue