Skip to content

Commit be710a9

Browse files
committed
fix(core): watch route path for better reactivity
1 parent 72ecb3e commit be710a9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/.test/mount.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import {DeepPartial} from "utility-types";
99
type InstanceType<V> = V extends { new (...arg: any[]): infer X } ? X : never
1010
type VM<V> = InstanceType<V> & { unmount(): void }
1111

12-
let useRouteFacade = useRoute
12+
let useRouteFacade = () => {
13+
return <RouteLocationNormalizedLoaded> {
14+
path: '/'
15+
}
16+
}
1317
let inputArgs: DeepPartial<CreateSchemaOrgInput> = {
1418
canonicalHost: 'https://example.com/',
1519
defaultLanguage: 'en-AU',

packages/schema-org/useSchemaOrg/csr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function handleNodesCSR(client: SchemaOrgClient, input: Arrayable<UseSche
1818
() => client.options.provider.name === 'vitepress'
1919
// @ts-expect-error untyped
2020
? client.options.provider.useRoute().data.relativePath
21-
: client.options.provider.useRoute(),
21+
: client.options.provider.useRoute().path,
2222
() => {
2323
ctx = client.setupRouteContext(vm.uid)
2424

0 commit comments

Comments
 (0)