mirror of https://github.com/vuejs/core.git
chore(sfc-playground): correctly show selected version on start up
This commit is contained in:
parent
9183069888
commit
9e529f8acb
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue