mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 19:47:48 +00:00
Error reporting in new form.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div class="form-group">
|
||||
<div class="form-group"
|
||||
v-bind:class="{ 'has-error': hasError()}"
|
||||
>
|
||||
<div class="col-sm-12 text-sm">
|
||||
{{ title }}
|
||||
</div>
|
||||
@@ -9,6 +11,9 @@
|
||||
ref="str"
|
||||
:value="value" @input="handleInput"
|
||||
:placeholder="title">
|
||||
<ul class="list-unstyled" v-for="error in this.error">
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -19,11 +24,15 @@
|
||||
props: {
|
||||
title: String,
|
||||
name: String,
|
||||
value: String
|
||||
value: String,
|
||||
error: Array
|
||||
},
|
||||
methods: {
|
||||
handleInput(e) {
|
||||
this.$emit('input', this.$refs.str.value);
|
||||
},
|
||||
hasError: function () {
|
||||
return this.error.length > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user