wycats / sandpack-vue3

Vue3 components that give you the power of editable sandboxes that run in the browser.

Home Page:https://sandpack-vue3.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component toolkit for live running code editing experiences

Sandpack Vue3

Vue3 components that give you the power of editable sandboxes that run in the browser.

import { Sandpack } from 'codesandbox-sandpack-vue3';

<Sandpack template="vue3" />;

Read more

online demo

demo

ssg demo

Here's an example of a react version for comparison

https://stackblitz.com/edit/vitejs-vite-axyaxx

releases

https://github.com/jerrywu001/sandpack-vue3/releases

Sandpack Themes

A list of themes to customize your Sandpack components.

import { githubLight } from "@codesandbox/sandpack-themes";

<Sandpack theme={githubLight} />;

Read more

Documentation

For full documentation, visit https://sandpack.codesandbox.io/docs/

This project removes [devtools component && useSandpackLint hook]

SSG/SSR

Use vitepress/quasar

Register Components Globally

// main.ts
import SanpackPlugin from 'codesandbox-sandpack-vue3';

app.use(SanpackPlugin());
// tsconfig.json
{
  "compilerOptions": {
    "types": [
      "codesandbox-sandpack-vue3/global"
    ]
  }
}

registe components

Tips β˜•

When using vue, please do not write it that way, It will not take effect

// πŸ’€
<div style={{ height: 200 }}>

πŸ‘‰πŸ½Write it like this

<div style={{ height: '200px' }}>

install

npm i

npm run storybook

for nuxt3

  • nuxt.config.ts
import { defineNuxtConfig } from 'nuxt';

export default defineNuxtConfig({
  vite: {
    define: {
      'process.env.LOG': {},
    },
  },
});

Supported browsers

npx browserslist

About

Vue3 components that give you the power of editable sandboxes that run in the browser.

https://sandpack-vue3.netlify.app

License:MIT License


Languages

Language:TypeScript 96.2%Language:JavaScript 2.2%Language:Vue 1.0%Language:CSS 0.3%Language:HTML 0.2%Language:Shell 0.1%