组件特性

Playground

嵌入 StackBlitz 或 CodeSandbox 示例项目的组件。

Usage

Stackblitz

::playground
---
provider: stackblitz
repo: nuxt/starter
branch: v3
file: app.vue
---
::

CodeSandbox

::playground
---
provider: codesandbox
repo: nuxt/starter
branch: v3
file: app.vue
---
::

Props

provider
'stackblitz' | 'codesandbox'
Provider to use
repo
string
GitHub repository name (e.g. nuxt/starter)
branch
string
Branch name
id
string
Repository ID (e.g. for Stackblitz github-t1vjvm, for Codesandbox 8hq5qn)

You need to provide either repo or id prop, but not both.

dir
string
Directory to open in the playground (optional)
file
string
File path to open
title
string
Title of the iframe

::