Implement translation with Symfony translator within vue component

This commit is contained in:
Julie Lenaerts 2024-09-20 13:58:23 +02:00
parent c602c27b39
commit 9732b80298

View File

@ -17,7 +17,7 @@
<slot name="body"></slot>
</div>
<div class="modal-footer" v-if="!hideFooter">
<button class="btn btn-cancel" @click="$emit('close')">{{ closeKey }}</button>
<button class="btn btn-cancel" @click="$emit('close')">{{ trans(modalActionClose) }}</button>
<slot name="footer"></slot>
</div>
</div>
@ -55,12 +55,14 @@ export default defineComponent({
}
},
emits: ['close'],
computed: {
closeKey() {
console.log('close key', trans(MODAL_ACTION_CLOSE))
return trans(MODAL_ACTION_CLOSE)
}
}
setup() {
const modalActionClose = MODAL_ACTION_CLOSE;
return {
modalActionClose,
trans
};
},
});
</script>