Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

chore: add useRoute composable. #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/composables.mjs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const useNuxtApp = () => ({});
export const useRoute = () => ({query: {}, matched: [], fullPath: '', hash: '', path: '', params: {}, meta: {}});
2 changes: 1 addition & 1 deletion src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function useNuxtViteConfig() {
});

nuxt.hook('imports:sources', (presets) => {
const stubbedComposables = ['useNuxtApp'];
const stubbedComposables = ['useNuxtApp', 'useRoute'];
const appPreset = presets.find((p) => p.from === '#app');
if (appPreset) {
appPreset.imports = appPreset.imports.filter(
Expand Down