Skip to content

Commit 62e3bb9

Browse files
committed
Change style of previous button if there is an error and user is on finish screen
1 parent f55d51e commit 62e3bb9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/components/StepperActions.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<q-btn
3-
color=""
4-
flat
53
label="Previous"
64
no-caps
75
v-bind:class="cannotGoBack ? 'hidden' : ''"
6+
v-bind:color="boldPrevious ? 'primary' : ''"
7+
v-bind:flat="!boldPrevious"
88
v-on:click="navigatePrevious"
99
/>
1010
<span class="spacer" />
@@ -31,15 +31,19 @@
3131
</template>
3232

3333
<script lang="ts">
34-
import { defineComponent } from 'vue'
34+
import { computed, defineComponent } from 'vue'
3535
import { useApp } from 'src/store/app'
36+
import { useValidation } from 'src/store/validation'
3637
3738
export default defineComponent({
3839
name: 'StepperActions',
3940
4041
setup () {
4142
const { showAdvanced, cannotGoBack, cannotGoForward, navigateNext, navigatePrevious } = useApp()
43+
const { errors } = useValidation()
44+
4245
return {
46+
boldPrevious: computed(() => cannotGoForward.value && (errors.value.length > 0)),
4347
cannotGoBack,
4448
cannotGoForward,
4549
showAdvanced,

0 commit comments

Comments
 (0)