From: Evan You Date: Wed, 27 Dec 2023 02:08:26 +0000 (+0800) Subject: chore(sfc-playground): correctly show selected version on start up X-Git-Tag: v3.4.0-rc.3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e529f8acbeee90832cda8e09f0a968736e65332;p=thirdparty%2Fvuejs%2Fcore.git chore(sfc-playground): correctly show selected version on start up --- diff --git a/packages/sfc-playground/src/Header.vue b/packages/sfc-playground/src/Header.vue index 49e370e6c3..48585a8e64 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)