mirror of
https://github.com/Fabio286/mizar.git
synced 2025-06-05 16:59:47 +02:00
refactor: i18n implementation
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
<div id="popcontainer">
|
||||
<div class="popup">
|
||||
<div class="box-100">
|
||||
<h4>Modifica Messaggio</h4>
|
||||
<h4>{{ t('message.editMessage') }}</h4>
|
||||
<div class="input-element">
|
||||
<label>Nome</label>
|
||||
<label>{{ t('word.name', 1) }}</label>
|
||||
<input
|
||||
v-model="staticMsg.name"
|
||||
type="text"
|
||||
@ -13,18 +13,18 @@
|
||||
>
|
||||
</div>
|
||||
<div class="input-element">
|
||||
<label>Messaggio</label>
|
||||
<label>{{ t('word.message', 1) }}</label>
|
||||
<textarea
|
||||
v-model="staticMsg.message"
|
||||
required
|
||||
>Corpo del messaggio</textarea>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-element">
|
||||
<label>Formato</label>
|
||||
<label>{{ t('word.format') }}</label>
|
||||
<select v-model="staticMsg.format" required>
|
||||
<option value="" disabled>
|
||||
Seleziona
|
||||
{{ t('word.select') }}
|
||||
</option>
|
||||
<option value="ascii">
|
||||
ASCII
|
||||
@ -36,14 +36,14 @@
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button class="cancel" @click="close">
|
||||
Annulla
|
||||
{{ t('word.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
class="confirm"
|
||||
:disabled="validation"
|
||||
@click="confirm"
|
||||
>
|
||||
Modifica
|
||||
{{ t('word.edit') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -52,25 +52,28 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const props = defineProps({
|
||||
message: Object,
|
||||
index: Number
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const staticMsg = ref(Object.assign({}, props.message));
|
||||
|
||||
const emit = defineEmits(['hideEditMessage', 'editMessage']);
|
||||
const emit = defineEmits(['hide-edit-message', 'edit-message']);
|
||||
|
||||
const validation = computed(() => {
|
||||
return staticMsg.value.message === '' || staticMsg.value.name === '' || staticMsg.value.format === '';
|
||||
});
|
||||
|
||||
const close = () => {
|
||||
emit('hideEditMessage');
|
||||
emit('hide-edit-message');
|
||||
};
|
||||
|
||||
const confirm = () => {
|
||||
emit('editMessage', staticMsg.value, props.index);
|
||||
emit('edit-message', staticMsg.value, props.index);
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user