File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
docs/.vitepress/vitepress/composables Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,27 @@ export const usePlayground = (source: string) => {
1818
1919 const encoded = code ? utoa ( JSON . stringify ( originCode ) ) : ''
2020
21- let link = ` https://element-plus.run/`
21+ const link = new URL ( ' https://element-plus.run/' )
2222
2323 if ( usePreview ( ) ) {
24- link = ` ${ link } ?pr= ${ usePreviewPR ( ) } `
24+ link . searchParams . append ( 'pr' , usePreviewPR ( ) )
2525 }
2626
2727 if ( isDark . value ) {
28- link = `${ link } ${ usePreview ( ) ? '&' : '?' } theme=dark`
28+ link . searchParams . append ( 'theme' , 'dark' )
29+ }
30+
31+ if ( code . includes ( '@vueuse/core' ) ) {
32+ link . searchParams . append ( 'extra_packages' , '@vueuse/core' )
2933 }
3034
3135 if ( code ) {
32- link += `# ${ encoded } `
36+ link . hash = encoded
3337 }
3438
3539 return {
3640 encoded,
37- link,
41+ link : link . toString ( ) ,
3842 }
3943}
4044
You can’t perform that action at this time.
0 commit comments