File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div :class =" $style.map" :style =" style" >
3
- <BSRow v-for =" (row, index) in rows" :key =" index " :src =" row" :row =" index" />
3
+ <BSRow v-for =" ({ row, id }, index) in rows" :key =" id " :src =" row" :row =" index" />
4
4
</div >
5
5
</template >
6
6
@@ -20,8 +20,16 @@ const props = defineProps<{
20
20
size: number ;
21
21
}>();
22
22
23
- const rows = computed (() => props .content .split (' \n ' ));
24
- const cols = computed (() => max (rows .value .map ((row ) => row .split (' \\ ' ).length )) || 1 );
23
+ const rows = computed (() => {
24
+ const appears: Record <string , number > = {};
25
+ return props .content .split (' \n ' ).map ((row ) => {
26
+ const id = (appears [row ] ?? - 1 ) + 1 ;
27
+ appears [row ] = id ;
28
+ return { row , id: ` ${row }#${id } ` };
29
+ });
30
+ });
31
+
32
+ const cols = computed (() => max (rows .value .map (({ row }) => row .split (' \\ ' ).length )) || 1 );
25
33
26
34
const style = computed (() => ({
27
35
' --bs-map-size' : props .size ,
You can’t perform that action at this time.
0 commit comments