Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09c88e9

Browse files
committed
feat: support config ssr prop in vitepress
1 parent ff4fc27 commit 09c88e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugin.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ function getCode(code: string, options?: VuePreviewPluginOptions) {
1414
expandProps += ` previewAppStyle="${encodeURIComponent(JSON.stringify(options.props.previewAppStyle))}"`
1515
if (options?.props?.importMap)
1616
expandProps += ` importMap="${encodeURIComponent(JSON.stringify(options.props.importMap))}"`
17+
if (options?.props?.ssr)
18+
expandProps += ' ssr'
1719

18-
return code.trim() ? `<VuePreview code="${str}" ${expandProps} encode ssr></VuePreview>\n` : '<VuePreview ssr></VuePreview>\n'
20+
return code.trim() ? `<VuePreview code="${str}" ${expandProps} encode />\n` : '<VuePreview />\n'
1921
}
2022

2123
interface VuePreviewPluginOptions {
2224
props?: {
2325
previewBodyStyle?: Props['previewBodyStyle']
2426
previewAppStyle?: Props['previewAppStyle']
2527
importMap?: Record<string, string>
28+
ssr?: boolean
2629
}
2730
}
2831

0 commit comments

Comments
 (0)