组件特性

Playground

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

Usage

Stackblitz

在线代码示例

加载后将连接 StackBlitz,可以直接运行和编辑代码。

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

CodeSandbox

在线代码示例

加载后将连接 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

::