Skip to content

Commit

Permalink
remove the errorUnescaped property, add v-html on the error part
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiadong.Yu committed Jan 9, 2018
1 parent 79a77bd commit ecd2ca5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/formGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ div.vue-form-generator(v-if='schema != null')
button(v-for='btn in field.buttons', @click='buttonClickHandler(btn, field, $event)', :class='btn.classes') {{ btn.label }}
.hint(v-if='field.hint') {{ fieldHint(field) }}
.errors.help-block(v-if='fieldErrors(field).length > 0')
span(v-for='(error, index) in fieldErrors(field)', v-if='field.errorUnescaped', v-html="error", track-by='index')
span(v-for='(error, index) in fieldErrors(field)', v-if='!field.errorUnescaped', track-by='index') {{ error }}
span(v-for='(error, index) in fieldErrors(field)', v-html="error", track-by='index')

template(v-for='group in groups')
fieldset(:is='tag', :class='getFieldRowClasses(group)')
Expand All @@ -33,8 +32,7 @@ div.vue-form-generator(v-if='schema != null')
button(v-for='btn in field.buttons', @click='buttonClickHandler(btn, field, $event)', :class='btn.classes') {{ btn.label }}
.hint(v-if='field.hint') {{ field.hint }}
.errors.help-block(v-if='fieldErrors(field).length > 0')
span(v-for='(error, index) in fieldErrors(field)', v-if='field.errorUnescaped', v-html="error", track-by='index')
span(v-for='(error, index) in fieldErrors(field)', v-if='!field.errorUnescaped', track-by='index') {{ error }}
span(v-for='(error, index) in fieldErrors(field)', v-html="error", track-by='index')
</template>

<script>
Expand Down

0 comments on commit ecd2ca5

Please sign in to comment.