feat(sfc): support resolving template components from <script setup>
exports
This commit is contained in:
parent
aa06b1034d
commit
6f5d840612
@ -244,7 +244,12 @@ export function resolveComponentType(
|
|||||||
return builtIn
|
return builtIn
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. user component (resolve)
|
// 3. user component (from setup bindings)
|
||||||
|
if (context.bindingMetadata[tag] === 'setup') {
|
||||||
|
return `$setup[${JSON.stringify(tag)}]`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. user component (resolve)
|
||||||
context.helper(RESOLVE_COMPONENT)
|
context.helper(RESOLVE_COMPONENT)
|
||||||
context.components.add(tag)
|
context.components.add(tag)
|
||||||
return toValidAssetId(tag, `component`)
|
return toValidAssetId(tag, `component`)
|
||||||
|
@ -10,7 +10,12 @@ export const compilerOptions: CompilerOptions = reactive({
|
|||||||
hoistStatic: false,
|
hoistStatic: false,
|
||||||
cacheHandlers: false,
|
cacheHandlers: false,
|
||||||
scopeId: null,
|
scopeId: null,
|
||||||
ssrCssVars: `{ color }`
|
ssrCssVars: `{ color }`,
|
||||||
|
bindingMetadata: {
|
||||||
|
TestComponent: 'setup',
|
||||||
|
foo: 'setup',
|
||||||
|
bar: 'props'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const App = {
|
const App = {
|
||||||
|
Loading…
Reference in New Issue
Block a user