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
|
||||
}
|
||||
|
||||
// 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.components.add(tag)
|
||||
return toValidAssetId(tag, `component`)
|
||||
|
@ -10,7 +10,12 @@ export const compilerOptions: CompilerOptions = reactive({
|
||||
hoistStatic: false,
|
||||
cacheHandlers: false,
|
||||
scopeId: null,
|
||||
ssrCssVars: `{ color }`
|
||||
ssrCssVars: `{ color }`,
|
||||
bindingMetadata: {
|
||||
TestComponent: 'setup',
|
||||
foo: 'setup',
|
||||
bar: 'props'
|
||||
}
|
||||
})
|
||||
|
||||
const App = {
|
||||
|
Loading…
Reference in New Issue
Block a user