chore: Update data loaders defineBasicLoader function in data-loaders.[id].vue
All checks were successful
CI / cache-and-install (push) Successful in 1m17s
All checks were successful
CI / cache-and-install (push) Successful in 1m17s
This commit is contained in:
@ -1,13 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// https://uvr.esm.is/data-loaders/rfc.html
|
|
||||||
|
|
||||||
import { defineBasicLoader } from 'unplugin-vue-router/data-loaders/basic';
|
import { defineBasicLoader } from 'unplugin-vue-router/data-loaders/basic';
|
||||||
|
// https://uvr.esm.is/data-loaders/rfc.html
|
||||||
|
|
||||||
export const usePageData = defineBasicLoader(
|
export const usePageData = defineBasicLoader(
|
||||||
'DataLoadersId',
|
'DataLoadersId',
|
||||||
async (...args) => {
|
async (route, ...otherArgs) => {
|
||||||
console.log('[DefineLoaderFn]', 'args :>> ', args);
|
console.log('[DefineLoaderFn]', 'otherArgs :>> ', otherArgs);
|
||||||
const [route] = args;
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 777));
|
await new Promise((resolve) => setTimeout(resolve, 777));
|
||||||
return { idFromPreviousPage: route.params.id, someOtherData: 'someOtherData' };
|
return { idFromPreviousPage: route.params.id, someOtherData: 'someOtherData' };
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user