Skip to content

Commit fcbb687

Browse files
authored
fix(ui): use a Vue key so file paths update correctly (#389)
1 parent aa3d413 commit fcbb687

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/runtime/src/components/Checker.ce.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ defineProps<{
55
diagnostics?: any[]
66
base: string
77
}>()
8+
9+
const key = (diagnostic: any): string => {
10+
if (diagnostic.loc) {
11+
return `${diagnostic.loc.file}-${diagnostic.loc.line}-${diagnostic.loc.column}`;
12+
} else {
13+
return diagnostic.id;
14+
}
15+
}
816
</script>
917

1018
<template>
1119
<ul>
12-
<Diagnostic v-for="d in diagnostics" :diagnostic="d" :base="base" />
20+
<Diagnostic v-for="d in diagnostics" :diagnostic="d" :base="base" :key="key(d)" />
1321
</ul>
1422
</template>
1523

0 commit comments

Comments
 (0)