Skip to content

Commit aebbaba

Browse files
committed
fix(v-key): avoids duplicated v-for keys, for #5
ref: (since vue 2.5.10) vuejs/vue#7200
1 parent 4a44809 commit aebbaba

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

examples/App.vue

+25-23
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,32 @@
1414
<positional-audio loop url="static/Project_Utopia.ogg"
1515
:volume="0.3" :position="{ y: 10 }"></positional-audio>
1616

17-
<movement-system :key="ui.sysKey">
18-
<mass-object :rv0="{ x: 2, y: 2 }" :v0="{ x: 10 }"
19-
:f="{ x: -3, y: -2 }" :m="1">
20-
<cube texture="cobblestone" :size="1"></cube>
21-
</mass-object>
22-
<mass-object :rv0="{ x: 2, z: 2 }" :v0="{ z: 20 }"
23-
:f="{ y: -1, z: -8 }" :m="1.2">
24-
<cube texture="diamond" :size="1.2"></cube>
25-
</mass-object>
26-
<movement-object :rv0="{ x: 2, z: 2 }" :v0="{ x: 15, z: -20 }"
27-
:a="{ x: -6, y: .5, z: 6 }">
28-
<cube texture="redwool" :size="1.1"></cube>
29-
</movement-object>
30-
</movement-system>
17+
<div :key="ui.sysKey">
18+
<movement-system>
19+
<mass-object :rv0="{ x: 2, y: 2 }" :v0="{ x: 10 }"
20+
:f="{ x: -3, y: -2 }" :m="1">
21+
<cube texture="cobblestone" :size="1"></cube>
22+
</mass-object>
23+
<mass-object :rv0="{ x: 2, z: 2 }" :v0="{ z: 20 }"
24+
:f="{ y: -1, z: -8 }" :m="1.2">
25+
<cube texture="diamond" :size="1.2"></cube>
26+
</mass-object>
27+
<movement-object :rv0="{ x: 2, z: 2 }" :v0="{ x: 15, z: -20 }"
28+
:a="{ x: -6, y: .5, z: 6 }">
29+
<cube texture="redwool" :size="1.1"></cube>
30+
</movement-object>
31+
</movement-system>
3132

32-
<oimo-world :key="ui.sysKey" :options="{ gravity: [0, 1, 0] }">
33-
<space-system :m-scale="10 ** 4">
34-
<space-object v-for="t in textures" :key="t">
35-
<oimo-body :options="{ move: true, density: 1 }">
36-
<cube :texture="t" :size="1"></cube>
37-
</oimo-body>
38-
</space-object>
39-
</space-system>
40-
</oimo-world>
33+
<oimo-world :options="{ gravity: [0, 1, 0] }">
34+
<space-system :m-scale="10 ** 4">
35+
<space-object v-for="t in textures" :key="t">
36+
<oimo-body :options="{ move: true, density: 1 }">
37+
<cube :texture="t" :size="1"></cube>
38+
</oimo-body>
39+
</space-object>
40+
</space-system>
41+
</oimo-world>
42+
</div>
4143
</scene>
4244
</renderer>
4345
</template>

examples/SF03.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
</m-obj-mtl>
88
</mesh>
99

10-
<mesh v-for="n in 2" :key="n" :scale="4"
10+
<mesh v-for="n in 2" :key="`1-${n}`" :scale="4"
1111
:position="{ x: 5 * Math.sign(n - 1.5), z: 0.8 }">
1212
<geometry type="Plane" :args="[1, 1]"></geometry>
1313
<material type="MeshBasic" :options="detonation.matOpts">
1414
<texture url="lensflare0_alpha.png"></texture>
1515
</material>
1616
</mesh>
1717

18-
<object3d v-for="n in 2" :key="n"
18+
<object3d v-for="n in 2" :key="`2-${n}`"
1919
:rotation="{ y: Math.PI / 2 }" :scale="4"
2020
:position="{ x: 5 * Math.sign(n - 1.5), z: 2.6 }">
2121
<mesh v-for="n1 in 4" :key="n1"

0 commit comments

Comments
 (0)