Skip to content

Standalone Output Component #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phantomlsh opened this issue Sep 28, 2021 · 3 comments
Closed

Standalone Output Component #2

phantomlsh opened this issue Sep 28, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@phantomlsh
Copy link

As initially discussed here, for both the standalone and the embedded use cases, you could consider extracting the Output component whose only purpose is to show compiled results or preview. Store data like files and importmap could be provided through the prop.

Then it's possible to use any favorable editor(monaco or codemirror) with the Output component, and we could use the Output component alone as a readonly preview of a project.

@phantomlsh phantomlsh changed the title Standalone playground Standalone Output Component Oct 5, 2021
@phantomlsh
Copy link
Author

phantomlsh commented Oct 6, 2021

@yyx990803 Would you consider building such a component(package)? If so, I can contribute!

@CutePikachu
Copy link

That's a great idea. I am looking forward to it as well.

@wangcch
Copy link
Collaborator

wangcch commented Feb 19, 2025

Now we can use preview standalone in version ^4.5.1.
https://github.com/vuejs/repl?tab=readme-ov-file#advanced-usage

<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>

@wangcch wangcch closed this as completed Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants