UNPKG

@u3u/vue-hooks

Version:
8 lines (7 loc) 275 B
import { computed } from '@vue/composition-api'; import { getRuntimeVM } from './util/runtime'; export default function useRouter() { var vm = getRuntimeVM(); var route = computed(function () { return vm.$route; }); return { route: route, router: vm.$router }; }