Skip to content

Vue

安装

bash
pnpm add @sandboxrun/vue
bash
npm i @sandboxrun/vue

注册组件

ts
// src/main.ts
import { createApp } from 'vue';
import { SandBoxRun } from '@sandboxrun/vue'; 
import App from './App.vue';
import '@sandboxrun/vue/style'; 

const app = createApp(App);
app.component('SandBoxRun', SandBoxRun); 
app.mount('#app');

SandBoxRun Props

ts
interface SandBoxRunProps {
  html: string; // 初始 html 内容
  js: string; // 初始 js 内容
  css: string; // 初始 css 内容
}

演示

Code

vue
<SandBoxRun html="<div>Sandboxrun</div>" />

Released under the MIT License.