Add Sandpack playground Support #3408
FuckDoctors
started this conversation in
Ideas
Replies: 4 comments 5 replies
-
代码示例: ::: sandpack#vue Vue demo with customized options
@file src/App.vue
```vue
<script setup>
import { ref } from "vue";
const msg = ref("Hello Playground!");
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg" />
</template>
```
@options
```js
{
readOnly: true,
showReadOnly: true
}
```
@setup
```js
{
entry: "/index.js",
}
```
:::
|
Beta Was this translation helpful? Give feedback.
0 replies
-
可以,如果 playground 做多了,我们可以把它独立成一个新的插件,然后把体积大的依赖设成 peers |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Mister-Hope feat/sandpack 代码初版完成,有空了可以 review 一下。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Mister-Hope 大佬求助。 要设的选项使用 @file /src/App.vue {active readOnly} 单元测试跟预想的一样,但是实际运行效果不一样。。。 示例: ::: sandpack Sandpack demo with options
@file /src/App.vue {readOnly hidden}
```vue
<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg" />
</template>
```
@file /src/Comp.vue {active}
```vue
<template>
<div>Comp</div>
</template>
```
@file Comp2.vue \\{hidden}
```vue
<template>
<div>Comp2</div>
</template>
```
::: |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
是否需要添加 Sandpack Playground 支持。
加入的话,会额外引入依赖(虽然是懒加载),依赖较大。
中途版代码:feat/sandpack
Beta Was this translation helpful? Give feedback.
All reactions