useRouter has to be called in setup or returns undefined otherwise. See https://github.com/vuejs/vue-router/issues/3379