mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(vite, webpack): handle auto keys for composables without args (#7651)
This commit is contained in:
parent
f536bf5548
commit
42cf48e45d
@ -45,7 +45,7 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
|
|||||||
|
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'useState':
|
case 'useState':
|
||||||
if (node.arguments.length >= 2 || stringTypes.includes(node.arguments[0].type)) { return }
|
if (node.arguments.length >= 2 || stringTypes.includes(node.arguments[0]?.type)) { return }
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'useFetch':
|
case 'useFetch':
|
||||||
@ -55,7 +55,7 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
|
|||||||
|
|
||||||
case 'useAsyncData':
|
case 'useAsyncData':
|
||||||
case 'useLazyAsyncData':
|
case 'useLazyAsyncData':
|
||||||
if (node.arguments.length >= 3 || stringTypes.includes(node.arguments[0].type) || stringTypes.includes(node.arguments[node.arguments.length - 1].type)) { return }
|
if (node.arguments.length >= 3 || stringTypes.includes(node.arguments[0]?.type) || stringTypes.includes(node.arguments[node.arguments.length - 1]?.type)) { return }
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user