Skip to content

Commit

Permalink
fix(core): watch route path for better reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jul 19, 2022
1 parent 72ecb3e commit be710a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/.test/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import {DeepPartial} from "utility-types";
type InstanceType<V> = V extends { new (...arg: any[]): infer X } ? X : never
type VM<V> = InstanceType<V> & { unmount(): void }

let useRouteFacade = useRoute
let useRouteFacade = () => {
return <RouteLocationNormalizedLoaded> {
path: '/'
}
}
let inputArgs: DeepPartial<CreateSchemaOrgInput> = {
canonicalHost: 'https://example.com/',
defaultLanguage: 'en-AU',
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-org/useSchemaOrg/csr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function handleNodesCSR(client: SchemaOrgClient, input: Arrayable<UseSche
() => client.options.provider.name === 'vitepress'
// @ts-expect-error untyped
? client.options.provider.useRoute().data.relativePath
: client.options.provider.useRoute(),
: client.options.provider.useRoute().path,
() => {
ctx = client.setupRouteContext(vm.uid)

Expand Down

0 comments on commit be710a9

Please sign in to comment.