How can I close modal when press enter or esc

I write @keyup.enter="$emit(‘close’)"

and into parent
methods: {
close() {
this.isShowResultModal = false
}
}

Do you have @close="close" in the parent also to trigger the close method?