8000 docs: sandbox case · vuejs/repl@94b9930 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94b9930

Browse files
committed
docs: sandbox case
1 parent e3dc0d4 commit 94b9930

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,28 @@ productionMode.value = true
107107
<Repl :store="store" :editor="Monaco" :showCompileOutput="true" />
108108
</template>
109109
```
110+
111+
Use only the Preview without the editor
112+
113+
```vue
114+
<script setup>
115+
import { ref } from 'vue'
116+
import { Sandbox, useStore } from '@vue/repl'
117+
118+
// retrieve some configuration options from the URL
119+
const query = new URLSearchParams(location.search)
120+
121+
const store = useStore(
122+
{
123+
// custom vue version
124+
vueVersion: ref(query.get('vue')),
125+
},
126+
// initialize repl with previously serialized state
127+
location.hash,
128+
)
129+
</script>
130+
131+
<template>
132+
<Sandbox :store="store" />
133+
</template>
134+
```

0 commit comments

Comments
 (0)
0