fix translations in helper libraries models.js and utils.js

This commit is contained in:
smilerz
2022-02-25 13:16:34 -06:00
parent 90d477a0fd
commit dae49ec5f3
6 changed files with 171 additions and 119 deletions

View File

@ -1,39 +1,42 @@
<template>
<div>
<b-form-group
v-bind:label="label"
class="mb-3">
<b-form-select v-model="new_value" :placeholder="placeholder" :options="options"></b-form-select>
<b-form-group v-bind:label="label" class="mb-3">
<b-form-select v-model="new_value" :placeholder="placeholder" :options="translatedOptions"></b-form-select>
</b-form-group>
</div>
</template>
<script>
export default {
name: 'ChoiceInput',
props: {
field: {type: String, default: 'You Forgot To Set Field Name'},
label: {type: String, default: 'Text Field'},
value: {type: String, default: ''},
options: [],
placeholder: {type: String, default: 'You Should Add Placeholder Text'},
show_merge: {type: Boolean, default: false},
},
data() {
return {
new_value: undefined,
}
},
mounted() {
this.new_value = this.value
},
watch: {
'new_value': function () {
this.$root.$emit('change', this.field, this.new_value)
name: "ChoiceInput",
props: {
field: { type: String, default: "You Forgot To Set Field Name" },
label: { type: String, default: "Text Field" },
value: { type: String, default: "" },
options: [],
placeholder: { type: String, default: "You Should Add Placeholder Text" },
show_merge: { type: Boolean, default: false },
},
},
methods: {
}
data() {
return {
new_value: undefined,
}
},
mounted() {
this.new_value = this.value
},
watch: {
new_value: function () {
this.$root.$emit("change", this.field, this.new_value)
},
},
computed: {
translatedOptions() {
return this.options.map((x) => {
return { ...x, text: this.$t(x.text) }
})
},
},
methods: {},
}
</script>
</script>