CSR-266 create button-main component.
This commit is contained in:
parent
5f3f6c7175
commit
ec3c18dbef
3 changed files with 12 additions and 10 deletions
|
|
@ -22,7 +22,8 @@
|
||||||
</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
|
<buttonMain
|
||||||
|
isPrimary
|
||||||
buttonText="Primary"
|
buttonText="Primary"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1" />
|
sizeInRem="1" />
|
||||||
|
|
@ -887,7 +888,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import buttonPrimary from "@/ux-components/button-primary/button-primary";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import buttonSecondary from "@/ux-components/button-secondary/button-secondary";
|
import buttonSecondary from "@/ux-components/button-secondary/button-secondary";
|
||||||
import buttonBack from "@/common-components/button-back/button-back";
|
import buttonBack from "@/common-components/button-back/button-back";
|
||||||
import listCard from "@/ux-components/list-card/list-card";
|
import listCard from "@/ux-components/list-card/list-card";
|
||||||
|
|
@ -902,7 +903,7 @@ import textLink from "@/ux-components/text-link/text-link";
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {
|
components: {
|
||||||
buttonPrimary,
|
buttonMain,
|
||||||
buttonSecondary,
|
buttonSecondary,
|
||||||
buttonBack,
|
buttonBack,
|
||||||
listCard,
|
listCard,
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<button :disabled="isDisabled" :aria-disabled="isDisabled" class="btn d-flex align-items-center py-3 px-4" :class="isPrimary ? 'btn-primary' : 'btn-secondary'" @click="displayComponent">
|
<button :disabled="isDisabled" :aria-disabled="isDisabled" class="btn d-flex align-items-center py-3 px-4" :class="isPrimary ? 'btn-primary' : 'btn-secondary'" @click="clicked()">
|
||||||
<span class="m-0">{{ this.buttonText }}</span>
|
<span class="m-0">{{ this.buttonText }}</span>
|
||||||
<loader class="ms-2" v-if="display" v-bind:style="{ width: `${sizeInRem}rem`, height: `${sizeInRem}rem` }" v-bind:class="[this.loaderColor, this.loaderPosition]" />
|
<loader class="ms-2" v-if="isLoaderDisplayed" v-bind:style="{ width: `${sizeInRem}rem`, height: `${sizeInRem}rem` }" v-bind:class="[this.loaderColor, this.loaderPosition]" />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import loader from "@/ux-components/loader/loader";
|
import loader from "@/ux-components/loader/loader";
|
||||||
export default {
|
export default {
|
||||||
name: "buttonPrimary",
|
name: "buttonMain",
|
||||||
props: {
|
props: {
|
||||||
isPrimary: Boolean,
|
isPrimary: Boolean,
|
||||||
buttonText: String,
|
buttonText: String,
|
||||||
|
|
@ -19,13 +19,14 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
display: false,
|
isLoaderDisplayed: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
displayComponent() {
|
clicked() {
|
||||||
this.display = true;
|
this.isLoaderDisplayed = true;
|
||||||
},
|
this.$emit('click-event');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
loader,
|
loader,
|
||||||
Loading…
Reference in a new issue