Create listButton component.
Separate from buttonPrimary.
This commit is contained in:
parent
d425bf3db7
commit
3854b4aa90
3 changed files with 32 additions and 1 deletions
|
|
@ -58,7 +58,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col my-3 d-flex align-items-center">
|
||||
<buttonPrimary
|
||||
<listButton
|
||||
buttonText="List Button"
|
||||
class="list-button"
|
||||
/>
|
||||
|
|
@ -75,11 +75,13 @@
|
|||
<script>
|
||||
import buttonPrimary from "@/uxComponents/buttonPrimary/buttonPrimary";
|
||||
import radioCard from "@/uxComponents/radioCard/radioCard";
|
||||
import listButton from "@/uxComponents/listButton/listButton";
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
buttonPrimary,
|
||||
radioCard,
|
||||
listButton
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
1
src/uxComponents/listButton/listButton.spec.js
Normal file
1
src/uxComponents/listButton/listButton.spec.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
test.todo('some test to be written in the future');
|
||||
28
src/uxComponents/listButton/listButton.vue
Normal file
28
src/uxComponents/listButton/listButton.vue
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<template>
|
||||
<button
|
||||
class="btn d-flex align-items-center"
|
||||
v-on:click="showLoader()"
|
||||
v-bind:class="[this.isLoading ? 'button-loader' : 'not-loading']"
|
||||
>
|
||||
{{ this.buttonText }}
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "listButton",
|
||||
props: {
|
||||
buttonText: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showLoader() {
|
||||
this.isLoading = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in a new issue