mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Example usage of translation keys from yaml files within vue component
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<slot name="body"></slot>
|
||||
</div>
|
||||
<div class="modal-footer" v-if="!hideFooter">
|
||||
<button class="btn btn-cancel" @click="$emit('close')">{{ $t('action.close') }}</button>
|
||||
<button class="btn btn-cancel" @click="$emit('close')">{{ closeKey }}</button>
|
||||
<slot name="footer"></slot>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent} from "vue";
|
||||
import { trans, MODAL_ACTION_CLOSE } from '../../../../../../../../../../assets/translator'
|
||||
/*
|
||||
* This Modal component is a mix between Vue3 modal implementation
|
||||
* [+] with 'v-if:showModal' directive:parameter, html scope is added/removed not just shown/hidden
|
||||
@@ -53,7 +54,13 @@ export default defineComponent({
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['close']
|
||||
emits: ['close'],
|
||||
computed: {
|
||||
closeKey() {
|
||||
console.log('close key', trans(MODAL_ACTION_CLOSE))
|
||||
return trans(MODAL_ACTION_CLOSE)
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user