diff --git a/src/components/BSMap.vue b/src/components/BSMap.vue index 62bea1b..781f38a 100644 --- a/src/components/BSMap.vue +++ b/src/components/BSMap.vue @@ -1,6 +1,6 @@ @@ -20,8 +20,16 @@ const props = defineProps<{ size: number; }>(); -const rows = computed(() => props.content.split('\n')); -const cols = computed(() => max(rows.value.map((row) => row.split('\\').length)) || 1); +const rows = computed(() => { + const appears: Record = {}; + return props.content.split('\n').map((row) => { + const id = (appears[row] ?? -1) + 1; + appears[row] = id; + return { row, id: `${row}#${id}` }; + }); +}); + +const cols = computed(() => max(rows.value.map(({ row }) => row.split('\\').length)) || 1); const style = computed(() => ({ '--bs-map-size': props.size,