Skip to content

Commit

Permalink
test: 更新演练场
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Dec 1, 2023
1 parent d6681a7 commit bc69c01
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/fighting-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"preview": "vite preview"
},
"dependencies": {
"@vue/repl": "^1.3.2"
"@vue/repl": "^3.0.0"
},
"devDependencies": {
"fflate": "^0.7.3"
},
"license": "MIT"
}
}
56 changes: 56 additions & 0 deletions packages/fighting-playground/src/App copy.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script lang="ts" setup>
import { Repl } from '@vue/repl'
import { ReplStore as MyReplStore } from './store'
import { watchEffect } from 'vue'
import '@vue/repl/style.css'
import HeaderVue from './components/Header.vue'
import CodeMirror from '@vue/repl/codemirror-editor'
import type { ReplStore } from '@vue/repl'
const store = new MyReplStore({
serializedState: location.hash.slice(1),
defaultVueRuntimeURL:
'https://unpkg.com/@vue/[email protected]/dist/runtime-dom.esm-browser.js'
}) as unknown as ReplStore
// 将状态持久化到 URL 哈希
watchEffect(() => history.replaceState({}, '', store.serialize()))
</script>

<template>
<header-vue />
<!-- <repl :store="store" show-compile-output :editor="CodeMirror" /> -->
<repl :editor="CodeMirror" />
</template>

<style lang="scss">
* {
margin: 0;
padding: 0;
}
.vue-repl {
position: fixed;
top: 55px;
right: 0;
bottom: 0;
left: 0;
.file.active {
color: #2d5af1;
border-bottom: 3px solid #2d5af1;
.label {
color: #2d5af1;
}
}
.active {
border-bottom: 3px solid #2d5af1 !important;
span {
color: #2d5af1;
}
}
}
</style>
4 changes: 3 additions & 1 deletion packages/fighting-playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { watchEffect } from 'vue'
import '@vue/repl/style.css'
import HeaderVue from './components/Header.vue'
import CodeMirror from '@vue/repl/codemirror-editor'
import type { ReplStore } from '@vue/repl'
const store = new MyReplStore({
Expand All @@ -18,7 +19,8 @@

<template>
<header-vue />
<repl :store="store" show-compile-output />
<!-- <repl :store="store" show-compile-output :editor="CodeMirror" /> -->
<repl :editor="CodeMirror" />
</template>

<style lang="scss">
Expand Down
12 changes: 4 additions & 8 deletions pnpm-lock.yaml

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

0 comments on commit bc69c01

Please sign in to comment.