|
1 |
| -# Vue 3 + TypeScript + Vite |
| 1 | +# CodePlayer |
2 | 2 |
|
3 |
| -This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. |
| 3 | +<p align="center"> |
| 4 | + <p>CodePlayer 是一款轻量、免登录、极快运行速度的 WebIDE,可以在线编写 vue2/3、react 等应用代码并运行,性能远超 CodePen、CodeSandbox、Stackblitz 等同类的产品。</p> |
| 5 | + <a href="https://play.fe-dev.cn">在线体验</a> | |
| 6 | + <a href="https://play.fe-dev.cn/docs">使用手册</a> |
| 7 | +</p> |
4 | 8 |
|
5 |
| -## Recommended IDE Setup |
| 9 | +[](https://www.npmjs.com/package/codeplayer) |
| 10 | +[](https://github.com/zh-lx/codeplayer) |
| 11 | +[](https://opensource.org/licenses/MIT) |
6 | 12 |
|
7 |
| -- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). |
| 13 | +</div> |
8 | 14 |
|
9 |
| -## Type Support For `.vue` Imports in TS |
| 15 | + |
10 | 16 |
|
11 |
| -TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. |
| 17 | +## 安装 |
12 | 18 |
|
13 |
| -If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: |
| 19 | +```shell |
| 20 | +npm i codeplayer |
| 21 | +# or |
| 22 | +yarn add codeplayer |
| 23 | +# or |
| 24 | +pnpm add codeplayer |
| 25 | +``` |
14 | 26 |
|
15 |
| -1. Disable the built-in TypeScript Extension |
16 |
| - 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette |
17 |
| - 2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` |
18 |
| -2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. |
| 27 | +## 使用 |
| 28 | + |
| 29 | +具体的使用参照[使用手册](http://play.fe-dev.cn/docs/guide/start.html) |
| 30 | + |
| 31 | +## 支持语法 |
| 32 | + |
| 33 | +- ✅ html |
| 34 | +- ✅ js/ts |
| 35 | +- ✅ css/less/scss |
| 36 | +- ✅ jsx/tsx |
| 37 | +- ✅ vue2/3 |
| 38 | +- ✅ react |
| 39 | + |
| 40 | +## 速度对比 |
| 41 | + |
| 42 | +- 比较基准: 以 Antd 组件库的 [Button Demo](https://ant.design/components/button-cn#%E4%BB%A3%E7%A0%81%E6%BC%94%E7%A4%BA) 为例,分别访问各个平台,记录 Demo 加载完毕的总时长 |
| 43 | +- 测试环境: Chrome v118、Windows 平台、100MB 带宽 |
| 44 | + |
| 45 | +| 平台 | 首次访问(无缓存) | 后续访问(有缓存) | Demo 地址 | |
| 46 | +| ----------- | ---------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 47 | +| CodePlayer | 8s | 2s | [CodePlayer](https://play.fe-dev.cn/?entry=index.html&activeFile=App.tsx&theme=dark#eNqNU9tq20AQ/ZWtXmyDpa0LheDIIomTQKBQExxoQS8b7cTadi+qtL5h/O+dWcmuDW7I045mzjk7c3a0i5SVsElKb3Q0jtJP99+n85+zB0aJLLcpnUwLu5jkEdg8whxjaQlChghjA16wohR1Ax5BL/PH+CqPGD+rl95XMfxZqhVCfsQvt/HUmUp49aoBwYWzHizRnx4mIBeUOxewwgCWVwrWlav9GWetpC8nElaqgDh8DJmyyiuh46YQGiaj5POpoldeQzZ1EmZabKFOeZsJs/HjcOmrk9sDR6oVUxJvE1WFNqQcEx3hCEubolaVZ35bUbPGySWN10koQ52zXsKNUDbxzaZ33Qq0NLKbB9+jYdSCYyOq5FfjLL7NjrB5V2jyaMxChnI1iAItGWNIRjdjzqExSVPyULkZXSVfyIHhGSGWzvD/s6jcMRF1pArr5UUSFW6+JqNRMsojQu9zu8dJDsPiCJ0DzyTP3mpn/vWOTnTVHSsw5+HZOc/2Z7DQcaEVPvsp47aqWhhai/HB2dziijSe1SQ0OVHtS1csDYokC/APGii82z7Jfg/ftjcYIJc4SQ34b9T9lPR5NsBZOvWLo/RCi3TxcZC7pffODtmjhs1hlB75dNoeao5bneRxin32B2ySsX7YjEBciAqXqTFCa1zidR0+6ThuVtpedNi7qlZG1Fssz9qoayTl7XnOyu7hTSy1fxd0kJaiKQHfP7sPwYc4Hjb4XNkcjw/htbK/Ef8Nj0v4lJMrGNI75RY2wWzZDYFuXkf7v6BCmeI=) | |
| 48 | +| CodePen | 12s | 4s | [CodePen](https://codepen.io/ischaqje-the-bold/pen/OJdgQew?editors=001) | |
| 49 | +| CodeSandbox | 19s | 17s | [CodeSandbox](https://codesandbox.io/s/yv7rzl) | |
| 50 | +| Stackblitz | 29s | 22s | [Stackblitz](https://stackblitz.com/edit/react-nxlcxa?file=demo.tsx) | |
| 51 | + |
| 52 | +## 交流与反馈 |
| 53 | + |
| 54 | +任何使用问题欢迎添加作者微信 `zhoulx1688888` 或者 QQ 群 `245077601` 进行咨询与反馈: |
| 55 | + |
| 56 | +<div style="display: flex;"> |
| 57 | + <img src="https://user-images.githubusercontent.com/73059627/226233691-848b2a40-f1a9-414e-a80f-3fc6c6209eb1.png" width="200" /> |
| 58 | + <img src="https://github.com/zh-lx/codeplayer/assets/73059627/24851d9e-4d94-4a33-94c7-dcc09696a67b" width="200" /> |
| 59 | +</div> |
0 commit comments