fix: template v-for 的 key 移到 template 标签,修复编译报错
- Vue 要求 <template v-for> 的 key 放在 template 标签上,而非内部元素
This commit is contained in:
@ -22,10 +22,9 @@
|
||||
<!-- 子任务:主线继续主干道(左对齐 + ↓连线),分支(SPAWN 协助)缩进 -->
|
||||
<view v-if="node.child_tasks && node.child_tasks.length">
|
||||
<!-- 主线子任务:左边缘对齐,形成笔直主干道,之间用 ↓ 连线 -->
|
||||
<template v-for="(child, i) in mainChildren">
|
||||
<view :key="'arrow-' + child.id" v-if="i > 0" class="ft-flow-arrow">↓</view>
|
||||
<template v-for="(child, i) in mainChildren" :key="'mc-' + child.id">
|
||||
<view v-if="i > 0" class="ft-flow-arrow">↓</view>
|
||||
<FlowTree
|
||||
:key="child.id"
|
||||
:node="child"
|
||||
:current-user="currentUser"
|
||||
:current-user-id="currentUserId"
|
||||
|
||||
@ -17,10 +17,9 @@
|
||||
<scroll-view v-else scroll-y class="tree-scroll" :style="{ height: scrollHeight + 'px' }">
|
||||
<view class="tree-root">
|
||||
<!-- 递归纵向流转树:根级主线之间用 ↓ 连线,分支由 FlowTree 内部缩进 -->
|
||||
<template v-for="(t, i) in product.task_tree">
|
||||
<view :key="'arrow-' + i" v-if="i > 0" class="ft-flow-arrow">↓</view>
|
||||
<template v-for="(t, i) in product.task_tree" :key="'rt-' + t.id">
|
||||
<view v-if="i > 0" class="ft-flow-arrow">↓</view>
|
||||
<FlowTree
|
||||
:key="t.id"
|
||||
:node="t"
|
||||
:current-user="currentUser"
|
||||
:current-user-id="currentUserId"
|
||||
|
||||
Reference in New Issue
Block a user