2022-09-17 07:08:30 +02:00
|
|
|
<!--
|
|
|
|
- TransactionDescription.vue
|
|
|
|
- Copyright (c) 2019 james@firefly-iii.org
|
|
|
|
-
|
|
|
|
- This file is part of Firefly III (https://github.com/firefly-iii).
|
|
|
|
-
|
|
|
|
- This program is free software: you can redistribute it and/or modify
|
|
|
|
- it under the terms of the GNU Affero General Public License as
|
|
|
|
- published by the Free Software Foundation, either version 3 of the
|
|
|
|
- License, or (at your option) any later version.
|
|
|
|
-
|
|
|
|
- This program is distributed in the hope that it will be useful,
|
|
|
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
- GNU Affero General Public License for more details.
|
|
|
|
-
|
|
|
|
- You should have received a copy of the GNU Affero General Public License
|
|
|
|
- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="form-group" v-bind:class="{ 'has-error': hasError()}">
|
2022-09-17 16:54:13 +02:00
|
|
|
<label class="col-sm-4 control-label">
|
2022-09-17 07:14:50 +02:00
|
|
|
{{ $t('form.title') }}
|
2022-09-17 16:54:13 +02:00
|
|
|
</label>
|
|
|
|
<div class="col-sm-8">
|
2022-09-17 07:08:30 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<input
|
|
|
|
ref="title"
|
2022-09-17 07:14:50 +02:00
|
|
|
:title="$t('form.title')"
|
2022-09-17 16:54:13 +02:00
|
|
|
v-model=title
|
2022-09-17 07:08:30 +02:00
|
|
|
autocomplete="off"
|
|
|
|
class="form-control"
|
|
|
|
name="title"
|
|
|
|
type="text"
|
|
|
|
@input="handleInput"
|
2022-09-17 16:54:13 +02:00
|
|
|
v-bind:placeholder="$t('form.title')"
|
2022-09-17 07:08:30 +02:00
|
|
|
>
|
|
|
|
<span class="input-group-btn">
|
|
|
|
<button
|
|
|
|
class="btn btn-default"
|
|
|
|
tabIndex="-1"
|
|
|
|
type="button"
|
|
|
|
v-on:click="clearTitle"><i class="fa fa-trash-o"></i></button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<ul v-for="error in this.error" class="list-unstyled">
|
|
|
|
<li class="text-danger">{{ error }}</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2022-09-17 16:54:13 +02:00
|
|
|
props: {
|
|
|
|
error: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
default() {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
value: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
}
|
|
|
|
},
|
2022-09-17 07:08:30 +02:00
|
|
|
name: "Title",
|
|
|
|
mounted() {
|
2022-09-17 16:54:13 +02:00
|
|
|
this.title = this.value;
|
2022-09-17 07:08:30 +02:00
|
|
|
},
|
|
|
|
components: {},
|
|
|
|
data() {
|
|
|
|
return {
|
2022-09-17 16:54:13 +02:00
|
|
|
title: ''
|
2022-09-17 07:08:30 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
hasError: function () {
|
|
|
|
return this.error.length > 0;
|
|
|
|
},
|
|
|
|
clearTitle: function () {
|
|
|
|
this.title = '';
|
|
|
|
},
|
2022-09-17 16:54:13 +02:00
|
|
|
handleInput() {
|
|
|
|
this.$emit('input', this.title);
|
2022-09-17 07:08:30 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|