From 942c1fb59de6522cc1d057f898c7580733773661 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 25 Feb 2025 00:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=B8=83=E5=B1=80=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=99=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + package-lock.json | 26 +++++++++++++++ package.json | 2 ++ public/turtorial/01/README.md | 27 ++++++++++++++++ public/turtorial/02/README.md | 1 + public/turtorial/03/README.md | 0 rsbuild.config.ts | 14 -------- src/App.vue | 24 ++++++++++---- src/components/Editors.vue | 16 +++++---- src/components/Preview.vue | 23 +++++++------ src/components/Tutorial.vue | 61 +++++++++++++++++++++++++++++++++++ src/env.d.ts | 0 src/main.ts | 1 + src/store.ts | 11 +++++++ src/vite-env.d.ts | 1 - 15 files changed, 171 insertions(+), 37 deletions(-) create mode 100644 public/turtorial/01/README.md create mode 100644 public/turtorial/02/README.md create mode 100644 public/turtorial/03/README.md create mode 100644 src/components/Tutorial.vue create mode 100644 src/env.d.ts delete mode 100644 src/vite-env.d.ts diff --git a/components.d.ts b/components.d.ts index 725d6fa..1fdf608 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,5 +19,6 @@ declare module 'vue' { NTag: typeof import('naive-ui')['NTag'] NText: typeof import('naive-ui')['NText'] Preview: typeof import('./src/components/Preview.vue')['default'] + Tutorial: typeof import('./src/components/Tutorial.vue')['default'] } } diff --git a/package-lock.json b/package-lock.json index 53f9707..50ae1c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,8 @@ "@codemirror/lang-javascript": "^6.2.3", "@vueuse/core": "^12.7.0", "codemirror": "^6.0.1", + "github-markdown-css": "^5.8.1", + "marked": "^15.0.7", "naive-ui": "^2.41.0", "normalize.css": "^8.0.1", "vue": "^3.5.13", @@ -1618,6 +1620,18 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/github-markdown-css": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-5.8.1.tgz", + "integrity": "sha512-8G+PFvqigBQSWLQjyzgpa2ThD9bo7+kDsriUIidGcRhXgmcaAWUIpCZf8DavJgc+xifjbCG+GvMyWr0XMXmc7g==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1820,6 +1834,18 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/marked": { + "version": "15.0.7", + "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.7.tgz", + "integrity": "sha512-dgLIeKGLx5FwziAnsk4ONoGwHwGPJzselimvlVskE9XLN4Orv9u2VA3GWw/lYUqjfA0rUT/6fqKwfZJapP9BEg==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", diff --git a/package.json b/package.json index 6d59dd5..7bb7388 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "@codemirror/lang-javascript": "^6.2.3", "@vueuse/core": "^12.7.0", "codemirror": "^6.0.1", + "github-markdown-css": "^5.8.1", + "marked": "^15.0.7", "naive-ui": "^2.41.0", "normalize.css": "^8.0.1", "vue": "^3.5.13", diff --git a/public/turtorial/01/README.md b/public/turtorial/01/README.md new file mode 100644 index 0000000..23760c6 --- /dev/null +++ b/public/turtorial/01/README.md @@ -0,0 +1,27 @@ +# 测试 + +## 什么是 HTML + +```html +
hello
+``` + +```css +.welcome { + color: red; +} +``` + +## 什么是 HTML + +## 什么是 HTML + +## 什么是 HTML + +## 什么是 HTML + +## 什么是 HTML + +## 什么是 HTML + +## 什么是 HTML diff --git a/public/turtorial/02/README.md b/public/turtorial/02/README.md new file mode 100644 index 0000000..302946b --- /dev/null +++ b/public/turtorial/02/README.md @@ -0,0 +1 @@ +# 什么是 CSS \ No newline at end of file diff --git a/public/turtorial/03/README.md b/public/turtorial/03/README.md new file mode 100644 index 0000000..e69de29 diff --git a/rsbuild.config.ts b/rsbuild.config.ts index 11b1400..4f03fd7 100644 --- a/rsbuild.config.ts +++ b/rsbuild.config.ts @@ -1,6 +1,5 @@ import { defineConfig } from "@rsbuild/core" import { pluginVue } from "@rsbuild/plugin-vue" -// import AutoImport from "unplugin-auto-import/rspack" import { NaiveUiResolver } from "unplugin-vue-components/resolvers" import Components from "unplugin-vue-components/rspack" @@ -17,19 +16,6 @@ export default defineConfig({ tools: { rspack: { plugins: [ - // AutoImport({ - // imports: [ - // "vue", - // { - // "naive-ui": [ - // "useDialog", - // "useMessage", - // "useNotification", - // "useLoadingBar", - // ], - // }, - // ], - // }), Components({ resolvers: [NaiveUiResolver()], }), diff --git a/src/App.vue b/src/App.vue index a5e8b04..b914a3e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,6 +2,7 @@ import { dateZhCN, zhCN } from "naive-ui" import Editors from "./components/Editors.vue" import Preview from "./components/Preview.vue" +import Tutorial from "./components/Tutorial.vue" import { useMagicKeys, whenever } from "@vueuse/core" const { ctrl_s } = useMagicKeys({ @@ -22,14 +23,25 @@ whenever(ctrl_r, () => {}) + diff --git a/src/components/Editors.vue b/src/components/Editors.vue index 2031303..4df9e50 100644 --- a/src/components/Editors.vue +++ b/src/components/Editors.vue @@ -1,7 +1,8 @@