Skip to content

Commit f190093

Browse files
committed
fix(compiler): update warning message for self-dependency detection and add root node for dynamic slots in transTag function
1 parent 2d815c5 commit f190093

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fe/packages/compiler/src/core/view-compiler.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function buildCompileView(module, isComponent = false, scriptRes, depthChain = [
198198
}
199199
// 检查自依赖:如果组件依赖自己,则跳过
200200
if (componentModule.path === module.path) {
201-
console.warn('[view]', `检测到自依赖,跳过处理: ${module.path}`)
201+
console.warn('[view]', `检测到循环依赖,跳过处理: ${module.path}`)
202202
continue
203203
}
204204

@@ -1027,10 +1027,12 @@ function transTag(opts) {
10271027
}
10281028
const vIfProps = withVIf.length > 0 ? `${withVIf.join(' ')} ` : ''
10291029
const vOtherProps = withoutVIf.length > 0 ? ` ${withoutVIf.join(' ')}` : ''
1030-
tagRes = `<template ${vIfProps}${generateSlotDirective(multipleSlots)}><${res}${vOtherProps}>`
1030+
// 动态插槽无法正常编译,添加根节点。
1031+
// Error: Codegen node is missing for element/if/for node. Apply appropriate transforms first.
1032+
tagRes = `<dd-block><template ${vIfProps}${generateSlotDirective(multipleSlots)}><${res}${vOtherProps}>`
10311033
}
10321034
else {
1033-
tagRes = `</${res}></template>`
1035+
tagRes = `</${res}></template></dd-block>`
10341036
}
10351037
}
10361038
else {

0 commit comments

Comments
 (0)