datav.jiaminghi.com icon indicating copy to clipboard operation
datav.jiaminghi.com copied to clipboard

在vite下用安装后,会出现[plugin:vite:vue] <template v-for> key should be placed on the <template> tag.错误。

Open dzyuan opened this issue 4 years ago • 1 comments

错误提示如下: [plugin:vite:vue]

错误位置源码如下:

<template>
  <div class="dv-decoration-6" :ref="ref">
    <svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
      <template
        v-for="(point, i) in points"
      >
        <rect
          :key="i"
          :fill="mergedColor[Math.random() > 0.5 ? 0 : 1]"
          :x="point[0] - halfRectWidth"
          :y="point[1] - heights[i] / 2"
          :width="rectWidth"
          :height="heights[i]"
        >

dzyuan avatar Oct 07 '21 11:10 dzyuan

That's what happened to me. Do you guys have a solution now?

jimpeo avatar Nov 20 '21 15:11 jimpeo