Browse Source

fix: Adjust code to be Vue 2.7 compatible as `key` on `<template>` is Vue3 only

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Ferdinand Thiessen 4 months ago
parent
commit
d14b351208
2 changed files with 10 additions and 6 deletions
  1. 6 5
      core/src/views/UnifiedSearch.vue
  2. 4 1
      tsconfig.json

+ 6 - 5
core/src/views/UnifiedSearch.vue

@@ -90,11 +90,12 @@
 		</template>
 
 		<!-- Grouped search results -->
-		<template v-for="({list, type}, typesIndex) in orderedResults" v-else :key="type">
-				<h2 class="unified-search__results-header">
-					{{ typesMap[type] }}
-				</h2>
-			<ul class="unified-search__results"
+		<template v-for="({list, type}, typesIndex) in orderedResults" v-else>
+			<h2 :key="type" class="unified-search__results-header">
+				{{ typesMap[type] }}
+			</h2>
+			<ul :key="type"
+				class="unified-search__results"
 				:class="`unified-search__results-${type}`"
 				:aria-label="typesMap[type]">
 				<!-- Search results -->

+ 4 - 1
tsconfig.json

@@ -1,6 +1,6 @@
 {
 	"extends": "@vue/tsconfig/tsconfig.json",
-	"include": ["./apps/**/*.ts", "./apps/**/*.vue", "./core/**/*.ts", "./*.d.ts"],
+	"include": ["./apps/**/*.ts", "./apps/**/*.vue", "./core/**/*.ts", "./core/**/*.vue", "./*.d.ts"],
 	"compilerOptions": {
 		"types": ["jest", "node", "vue", "vue-router"],
 		"outDir": "./dist/",
@@ -18,6 +18,9 @@
 		"resolveJsonModule": true,
 		"strict": true,
 	},
+	"vueCompilerOptions": {
+		"target": 2.7
+	},
 	"ts-node": {
 		// these options are overrides used only by ts-node
 		// same as our --compilerOptions flag and our TS_NODE_COMPILER_OPTIONS environment variable