Skip to content

Commit b267a4e

Browse files
fix(playground): マイナーバージョンまでで表記するように
Fix #29
1 parent 2e415d6 commit b267a4e

11 files changed

Lines changed: 19 additions & 12 deletions

File tree

.vitepress/pages/Playground.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,14 @@ onMounted(async () => {
368368
code.value = hashData.value.code;
369369
}
370370
if (hashData.value.version != null) {
371-
version.value = hashData.value.version;
371+
const completeVersion = /^(\d+\.\d+)\.\d+$/.exec(hashData.value.version);
372+
373+
// Backwards compatibility (e.g. 1.2.0 -> 1.2)
374+
if (completeVersion != null) {
375+
version.value = completeVersion[1];
376+
} else if (versionModules.has(hashData.value.version)) {
377+
version.value = hashData.value.version;
378+
}
372379
}
373380
}
374381

0 commit comments

Comments
 (0)