Skip to content

Commit 990a534

Browse files
committed
Move helper text logical conditions to computed
1 parent ae0d1c1 commit 990a534

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/Question.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</span>
2929
</template>
3030

31-
<span class="f-sub" v-if="question.subtitle || question.helpTextShow && (question.type === QuestionType.LongText || question.type === QuestionType.MultipleChoice)">
31+
<span class="f-sub" v-if="showHelperText">
3232
<span v-if="question.subtitle">{{ question.subtitle }}</span>
3333

3434
<span class="f-help" v-if="question.type === QuestionType.LongText && !isMobile" v-html="question.helpText || language.formatString(language.longTextHelpText)"></span>
@@ -240,6 +240,16 @@
240240
classes['field-' + this.question.type.toLowerCase().substring(8)] = true
241241
242242
return classes
243+
},
244+
245+
showHelperText() {
246+
if (this.question.subtitle) {
247+
return true
248+
}
249+
if (this.question.type === QuestionType.LongText || this.question.type === QuestionType.MultipleChoice) {
250+
return this.question.helpTextShow
251+
}
252+
return false
243253
}
244254
}
245255
}

0 commit comments

Comments
 (0)