[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2024-06-02 14:20:58 +00:00 committed by GitHub
parent 4616c172e0
commit 2ac90f37b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,28 +74,26 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
if (lazy) {
if (modifier) {
switch (modifier) {
case "Visible":
case "visible-":
case 'Visible':
case 'visible-':
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyIOClientPage' }]))
identifier += '_delayedIO'
imports.add(`const ${identifier} = createLazyIOClientPage(__defineAsyncComponent(${genDynamicImport(component.filePath, { interopDefault: false })}.then(c => c.${component.export ?? 'default'} || c)))`)
break;
case "Idle":
case "idle-":
break
case 'Idle':
case 'idle-':
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
imports.add(genImport(clientDelayedComponentRuntime, [{ name: 'createLazyNetworkClientPage' }]))
identifier += '_delayedNetwork'
imports.add(`const ${identifier} = createLazyNetworkClientPage(__defineAsyncComponent(${genDynamicImport(component.filePath, { interopDefault: false })}.then(c => c.${component.export ?? 'default'} || c)))`)
break;
break
}
}
else {
} else {
imports.add(genImport('vue', [{ name: 'defineAsyncComponent', as: '__defineAsyncComponent' }]))
identifier += '_lazy'
imports.add(`const ${identifier} = __defineAsyncComponent(${genDynamicImport(component.filePath, { interopDefault: false })}.then(c => c.${component.export ?? 'default'} || c)${isClientOnly ? '.then(c => createClientOnly(c))' : ''})`)
}
}
} else {
imports.add(genImport(component.filePath, [{ name: component._raw ? 'default' : component.export, as: identifier }]))