-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathFirstStep.vue
84 lines (84 loc) · 2.2 KB
/
FirstStep.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
<div class="step-content">
<p
v-if="status==='previous'"
class="step-description vocab-body body-normal"
>
{{ $t(cardText) }}
</p>
<div
v-else-if="status==='current'"
class="step-actions"
>
<div
class="field"
:class="yesSelected"
>
<b-radio
v-model="radio"
native-value="yes"
>
<span class="vocab-body body-normal">
{{ $t('stepper.yes') }}{{ $t(yesText) }}
</span>
</b-radio>
</div>
<div
class="field"
:class="noSelected"
>
<b-radio
v-model="radio"
native-value="no"
>
<span class="vocab-body body-normal">
{{ $t('stepper.no') }}{{ $t(noText) }}
</span>
</b-radio>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'FirstStep',
props: {
selected: Boolean,
stepId: Number,
status: String
},
computed: {
cardText() {
return this.$props.selected ? 'stepper.FS.selected' : 'stepper.FS.not-selected'
},
radio: {
get() {
if (this.$props.selected === undefined) {
return undefined
} else {
return this.$props.selected ? 'yes' : 'no'
}
},
set(newVal) {
this.$emit('change', 'FS', 0, newVal === 'yes')
}
},
yesText() {
return 'stepper.FS.selected'
},
noText() {
return 'stepper.FS.not-selected'
},
yesSelected() {
return this.$props.selected
? 'selected'
: 'not-selected'
},
noSelected() {
return this.$props.selected
? 'not-selected'
: 'selected'
}
}
}
</script>