Skip to content

Commit 246b12b

Browse files
committed
fix(vuepress-plugin-sandbox): vue-playground css not working
1 parent 78aaa0e commit 246b12b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
"paramtypes",
220220
"persistedstate",
221221
"pinzhi",
222+
"pluginutils",
222223
"pnpm",
223224
"popconfirm",
224225
"Popconfirm",

packages/vuepress-plugin-sandbox/src/enhanceAppFile.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ import {defineClientAppEnhance} from '@vuepress/client'
33
import {ConcreteComponent, DefineComponent, h, resolveComponent} from 'vue'
44
import * as base64 from 'js-base64'
55
import {SANDBOX_COMPONENT_NAME} from './constants'
6+
import css from '../node_modules/vue-playground/dist/style.css'
67

78
export default defineClientAppEnhance(async ({app}) => {
89
let Playground: DefineComponent<{}, {}, any> | undefined
910

1011
if (!__VUEPRESS_SSR__) {
12+
// add playground styles to global
13+
const styleEl = document.createElement('style')
14+
styleEl.innerHTML = css
15+
document.head.appendChild(styleEl)
16+
17+
// load playground
1118
const VuePlayground = await import('vue-playground')
1219
Playground = VuePlayground.Playground
1320
}

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)