Skip to content

Commit fd25071

Browse files
committed
refactor
1 parent 71800da commit fd25071

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/compiler-vapor/src/transforms/transformElement.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
type IRProp,
3030
type IRProps,
3131
type IRPropsDynamicAttribute,
32+
type IRPropsStatic,
3233
type VaporDirectiveNode,
3334
} from '../ir'
3435
import { EMPTY_EXPRESSION } from './utils'
@@ -125,7 +126,7 @@ function resolveSetupReference(name: string, context: TransformContext) {
125126

126127
function transformNativeElement(
127128
tag: string,
128-
propsResult: ReturnType<typeof buildProps>,
129+
propsResult: PropsResult,
129130
context: TransformContext<ElementNode>,
130131
) {
131132
const { scopeId } = context.options
@@ -179,7 +180,7 @@ function transformNativeElement(
179180

180181
export type PropsResult =
181182
| [dynamic: true, props: IRProps[], expressions: SimpleExpressionNode[]]
182-
| [dynamic: false, props: IRProp[]]
183+
| [dynamic: false, props: IRPropsStatic]
183184

184185
export function buildProps(
185186
node: ElementNode,

packages/compiler-vapor/src/transforms/transformSlotOutlet.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
type AttributeNode,
3-
type DirectiveNode,
43
type ElementNode,
54
ElementTypes,
65
ErrorCodes,
@@ -29,7 +28,7 @@ export const transformSlotOutlet: NodeTransform = (node, context) => {
2928
return
3029
}
3130
const id = context.reference()
32-
context.dynamic.flags |= DynamicFlag.INSERT
31+
context.dynamic.flags |= DynamicFlag.INSERT | DynamicFlag.NON_TEMPLATE
3332
const [fallback, exitBlock] = createFallback(
3433
node,
3534
context as TransformContext<ElementNode>,
@@ -124,10 +123,10 @@ function createFallback(
124123
tag: 'template',
125124
props: [],
126125
tagType: ElementTypes.TEMPLATE,
127-
children: [...node.children],
126+
children: node.children,
128127
})
129128

130-
const fallback: BlockIRNode = newBlock(node)
129+
const fallback = newBlock(node)
131130
const exitBlock = context.enterBlock(fallback)
132131
context.reference()
133132
return [fallback, exitBlock]

0 commit comments

Comments
 (0)