Skip to content

Commit

Permalink
docs: sandbox case
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcch committed Feb 16, 2025
1 parent e3dc0d4 commit 373659a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,28 @@ productionMode.value = true
<Repl :store="store" :editor="Monaco" :showCompileOutput="true" />
</template>
```

Use onlu the Preview without the editor

```vue
<script setup>
import { ref } from 'vue'
import { Sandbox, useStore } from '@vue/repl'
// retrieve some configuration options from the URL
const query = new URLSearchParams(location.search)
const store = useStore(
{
// custom vue version
vueVersion: ref(query.get('vue')),
},
// initialize repl with previously serialized state
location.hash,
)
</script>
<template>
<Sandbox :store="store" />
</template>
```

0 comments on commit 373659a

Please sign in to comment.