Set default text for subscription child
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
339e76d874
commit
d692cf3bdf
|
@ -22,7 +22,7 @@
|
|||
<ui-sprite src="trash" class="w-5 h-5"></ui-sprite>
|
||||
</a>
|
||||
</div>
|
||||
<a href="#" class="btn btn-sm flex btn-primary flex self-start mt-4" @click.prevent="inner.children.push({name: 'Beitrag {year} für {name} (' + inner.name + ')', amount: 0})">
|
||||
<a href="#" class="btn btn-sm flex btn-primary flex self-start mt-4" @click.prevent="inner.children.push({name: defaultChildName, amount: 0})">
|
||||
<ui-sprite src="plus" class="w-5 h-5"></ui-sprite>
|
||||
Position hinzufügen
|
||||
</a>
|
||||
|
@ -46,6 +46,12 @@ export default {
|
|||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
defaultChildName() {
|
||||
return this.inner.name ? `Beitrag {year} für {name} (${this.inner.name})` : 'Beitrag {year} für {name}';
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.mode === 'create' ? this.$inertia.post(`/subscription`, this.inner) : this.$inertia.patch(`/subscription/${this.inner.id}`, this.inner);
|
||||
|
|
Loading…
Reference in New Issue