mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt)!: only add $f
fetch prefix to auto-keys (#8852)
This commit is contained in:
parent
1496d3a07d
commit
17099348e7
@ -51,7 +51,7 @@ export function useFetch<
|
|||||||
if (!request) {
|
if (!request) {
|
||||||
throw new Error('[nuxt] [useFetch] request is missing.')
|
throw new Error('[nuxt] [useFetch] request is missing.')
|
||||||
}
|
}
|
||||||
const key = '$f' + _key
|
const key = _key === autoKey ? '$f' + _key : _key
|
||||||
|
|
||||||
const _request = computed(() => {
|
const _request = computed(() => {
|
||||||
let r = request
|
let r = request
|
||||||
|
@ -778,7 +778,7 @@ describe.skipIf(process.env.NUXT_TEST_DEV || isWindows)('payload rendering', ()
|
|||||||
it('renders a payload', async () => {
|
it('renders a payload', async () => {
|
||||||
const payload = await $fetch('/random/a/_payload.js', { responseType: 'text' })
|
const payload = await $fetch('/random/a/_payload.js', { responseType: 'text' })
|
||||||
expect(payload).toMatch(
|
expect(payload).toMatch(
|
||||||
/export default \{data:\{\$frand_a:\[[^\]]*\]\},prerenderedAt:\d*\}/
|
/export default \{data:\{rand_a:\[[^\]]*\]\},prerenderedAt:\d*\}/
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user