Skip to content

Commit

Permalink
fix: update import map when setting vue versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 17, 2021
1 parent db5cb99 commit 15cc696
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ export class ReplStore {
this.compiler = await this.pendingCompiler
this.pendingCompiler = null
this.state.vueRuntimeURL = runtimeUrl
const importMap = this.getImportMap()
;(importMap.imports || (importMap.imports = {})).vue = runtimeUrl
this.setImportMap(importMap)
console.info(`[@vue/repl] Now using Vue version: ${version}`)
}

Expand Down
2 changes: 1 addition & 1 deletion test/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const App = {
)
// }, 1000);

// store.setVueVersion('3.2.8')
store.setVueVersion('3.2.8')

return () =>
h(Repl, {
Expand Down

0 comments on commit 15cc696

Please sign in to comment.