diff --git a/packages/sfc-playground/src/Header.vue b/packages/sfc-playground/src/Header.vue index 49e370e6c..48585a8e6 100644 --- a/packages/sfc-playground/src/Header.vue +++ b/packages/sfc-playground/src/Header.vue @@ -27,6 +27,12 @@ const { store } = props const currentCommit = __COMMIT__ const vueVersion = ref(`@${currentCommit}`) +const vueURL = store.getImportMap().imports.vue +if (vueURL && !vueURL.startsWith(location.origin)) { + const versionMatch = vueURL.match(/runtime-dom@([^/]+)/) + if (versionMatch) vueVersion.value = versionMatch[1] +} + async function setVueVersion(v: string) { vueVersion.value = `loading...` await store.setVueVersion(v)