fix: template v-for 的 key 移到 template 标签,修复编译报错

- Vue 要求 <template v-for> 的 key 放在 template 标签上,而非内部元素
This commit is contained in:
2026-09-01 14:14:27 +08:00
parent 25ad5156f8
commit 6ff3ee06de
2 changed files with 4 additions and 6 deletions

View File

@ -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"

View File

@ -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"