From: Eduardo San Martin Morote Date: Mon, 13 Feb 2023 09:00:25 +0000 (+0100) Subject: chore: example in playground router setup [skip ci] X-Git-Tag: @pinia/nuxt@0.4.7~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=407bb1e7155918157a662104db9237acf9bdb72a;p=thirdparty%2Fvuejs%2Fpinia.git chore: example in playground router setup [skip ci] --- diff --git a/packages/playground/src/composables/router.ts b/packages/playground/src/composables/router.ts new file mode 100644 index 00000000..a6a74d7f --- /dev/null +++ b/packages/playground/src/composables/router.ts @@ -0,0 +1,9 @@ +import { getActivePinia } from 'pinia' + +export function useRouter() { + return getActivePinia()?._a.config.globalProperties.$router! +} + +export function useRoute() { + return getActivePinia()?._a.config.globalProperties.$route! +}