Skip to content

Commit 9e529f8

Browse files
committed
chore(sfc-playground): correctly show selected version on start up
1 parent 9183069 commit 9e529f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/sfc-playground/src/Header.vue

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const { store } = props
2727
const currentCommit = __COMMIT__
2828
const vueVersion = ref(`@${currentCommit}`)
2929
30+
const vueURL = store.getImportMap().imports.vue
31+
if (vueURL && !vueURL.startsWith(location.origin)) {
32+
const versionMatch = vueURL.match(/runtime-dom@([^/]+)/)
33+
if (versionMatch) vueVersion.value = versionMatch[1]
34+
}
35+
3036
async function setVueVersion(v: string) {
3137
vueVersion.value = `loading...`
3238
await store.setVueVersion(v)

0 commit comments

Comments
 (0)