Skip to content

Commit

Permalink
refactor: upgrade @vue/repl
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 24, 2023
1 parent 6103ffb commit f780d97
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@unocss/reset": "^0.53.3",
"@vue/repl": "^2.1.3",
"@vue/repl": "^2.2.0",
"@vueuse/core": "^10.2.0",
"element-plus": "^2.3.7",
"semver": "^7.5.3",
Expand All @@ -47,7 +47,7 @@
"unplugin-auto-import": "^0.16.4",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.3.9",
"vite-plugin-inspect": "^0.7.28",
"vite-plugin-inspect": "^0.7.29",
"vite-plugin-mkcert": "^1.15.0",
"vue-tsc": "^1.8.1"
}
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ body {
}
.vue-repl {
height: calc(100vh - var(--nav-height));
height: calc(100vh - var(--nav-height)) !important;
}
.dark .vue-repl,
Expand Down
9 changes: 6 additions & 3 deletions src/composables/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const useStore = (initial: Initial) => {
hideFile.value
)
state.files[ELEMENT_PLUS_FILE] = file
compileFile(store, file)
compileFile(store, file).then((errs) => (state.errors = errs))
},
{ immediate: true }
)
Expand Down Expand Up @@ -138,11 +138,14 @@ export const useStore = (initial: Initial) => {
async function init() {
await setVueVersion(versions.vue)

state.errors = []
for (const file of Object.values(state.files)) {
compileFile(store, file)
compileFile(store, file).then((errs) => state.errors.push(...errs))
}

watchEffect(() => compileFile(store, state.activeFile))
watchEffect(() =>
compileFile(store, state.activeFile).then((errs) => (state.errors = errs))
)
}

function getFiles() {
Expand Down

1 comment on commit f780d97

@vercel
Copy link

@vercel vercel bot commented on f780d97 Jun 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.