Skip to content

Commit 15a31cd

Browse files
committed
fix(vue-playground/doc-site): fix loading bug, fix build bug
1 parent d584653 commit 15a31cd

File tree

7 files changed

+20
-32
lines changed

7 files changed

+20
-32
lines changed

packages/doc-site/bundler.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const bundlerConfig = {
2121
output: {
2222
inlineDynamicImports: false,
2323
manualChunks: {
24-
monaco: ['monaco-editor', 'emmet-monaco-es']
24+
monaco: ['monaco-editor']
2525
}
2626
}
2727
}

packages/vue-playground/src/playground/components/loading.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ import {LoadingIcon} from './icon'
3131
max-width: 40px;
3232
height: 30%;
3333
max-height: 40px;
34+
animation: loadingCircle 1s infinite linear;
35+
}
36+
37+
@keyframes loadingCircle {
38+
to {
39+
transform: rotate(360deg);
40+
}
3441
}
3542
</style>

packages/vue-playground/src/playground/components/preview.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default defineComponent({
55
</script>
66
<script setup lang="ts">
77
import Message from './message.vue'
8+
import Loading from './loading.vue'
89
import {
910
defineComponent,
1011
ref,
@@ -125,11 +126,13 @@ defineExpose({
125126
<div ref="container" class="vue-playground-preview-iframe-container"></div>
126127
<Message :err="runtimeError" />
127128
<Message v-if="!runtimeError" :warn="runtimeWarning" />
129+
<Loading v-if="loading" />
128130
</div>
129131
</template>
130132

131133
<style scoped>
132134
.vue-playground-preview {
135+
position: relative;
133136
box-sizing: border-box;
134137
flex: 1;
135138
width: 100%;

packages/vue-playground/src/playground/playground.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,23 @@ defineExpose({
118118
></Toolbar>
119119
<div class="vue-playground-content" :style="contentStyle">
120120
<Preview
121+
ref="previewRef"
121122
:style="{
122123
borderTop: layoutDirection === 'EditorTopPreviewBottom' ? '1px solid var(--border-color)' : 'none',
123124
borderRight: layoutDirection === 'EditorRightPreviewLeft' ? '1px solid var(--border-color)' : 'none'
124125
}"
125126
></Preview>
126127
<Editor
127128
v-show="showCode"
128-
ref="EditorRef"
129+
ref="editorRef"
129130
:life-cycle="lifeCycle"
130131
:style="{
131132
borderTop: layoutDirection === 'EditorBottomPreviewTop' ? '1px solid var(--border-color)' : 'none',
132133
borderRight: layoutDirection === 'EditorLeftPreviewRight' ? '1px solid var(--border-color)' : 'none'
133134
}"
134135
></Editor>
135136
</div>
136-
<Loading v-if="editorRef?.loading" />
137+
<Loading v-if="!editorRef || editorRef.loading" />
137138
</div>
138139
</Portal>
139140
</template>

packages/vuepress-plugin-sandbox/build.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ export default defineBuildConfig({
44
entries: ['src/index', 'src/client', 'src/enhanceAppFile'],
55
clean: true,
66
declaration: true,
7+
// externals: ['js-base64'],
78
rollup: {
89
emitCJS: true,
9-
cjsBridge: true
10+
cjsBridge: true,
11+
inlineDependencies: true
1012
}
1113
})

packages/vuepress-plugin-sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"@vuepress/core": "2.0.0-beta.38",
6464
"@vuepress/markdown": "2.0.0-beta.38",
6565
"@vueuse/core": "^8.4.1",
66-
"js-base64": "^3.7.2",
6766
"markdown-it": "^13.0.1",
6867
"markdown-it-container": "^3.0.0",
6968
"monaco-editor": "^0.33.0",
@@ -78,6 +77,7 @@
7877
"conventional-changelog-cli": "^2.2.2",
7978
"cross-env": "^7.0.3",
8079
"esno": "^0.14.1",
80+
"js-base64": "^3.7.2",
8181
"jsdom": "^19.0.0",
8282
"rimraf": "^3.0.2",
8383
"superman-shared": "workspace:*",

pnpm-lock.yaml

Lines changed: 2 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)