query: { p: '%' },
})
})
+
+ it('keeps decoded values in hash', async () => {
+ // @ts-ignore: override to make the difference
+ encoding.decode = () => 'd'
+ // @ts-ignore
+ encoding.encodeHash = () => '#e'
+ const router = createRouter()
+ await router.push({ name: 'home', hash: '#%' })
+ expect(router.currentRoute.value).toMatchObject({
+ fullPath: '/#e',
+ hash: '#%',
+ })
+ })
})
}
let matchedRoute = matcher.resolve(matcherLocation, currentLocation)
- const hash = encodeHash(rawLocation.hash || '')
+ const hash = rawLocation.hash || ''
if (__DEV__ && hash && !hash.startsWith('#')) {
warn(
const fullPath = stringifyURL(
stringifyQuery,
assign({}, rawLocation, {
- hash,
+ hash: encodeHash(hash),
path: matchedRoute.path,
})
)