Can iview add events to router.js?

as shown above, I want to trigger an event when the user clicks X when the page is closed. Where should this event be written? Is it written and added in router.js?
for example:
{path: "message",
title:" message Center",
name: "message_index",
component: () = > import (" @ / views/message/message.vue")
}
or is it added somewhere else? Ask the great god to guide ~

Apr.02,2021

modify the source code / src/view/main/main.vue

handleCloseTag

Menu