feat(add docs):

This commit is contained in:
boommanpro
2024-08-05 23:41:00 +08:00
parent 9ef6111ff6
commit d47976b1e0
20 changed files with 145 additions and 137 deletions

View File

@@ -2,6 +2,11 @@
Monaco Editor 官方 rep: https://microsoft.github.io/monaco-editor/ Monaco Editor 官方 rep: https://microsoft.github.io/monaco-editor/
## 演示效果
演示站点https://boommanpro.github.io/vue3-vite-monaco-editor/
![演示图片](https://raw.githubusercontent.com/boommanpro/vue3-vite-monaco-editor/main/images/Snipaste_001.jpg)
## 整体链路 ## 整体链路
①创建vite项目 ①创建vite项目
@@ -41,8 +46,10 @@ self.MonacoEnvironment = {
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true); monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
``` ```
3. main.js 引入 -> `import './worker.js'` 3. main.js 引入 -> `import './worker.js'`
4. 创建组件 MonacoVite.vue 组件实现了双向绑定 4. 创建组件 MonacoVite.vue 组件实现了双向绑定
``` ```
<template> <template>
<div :style="{ <div :style="{

View File

@@ -4,4 +4,5 @@ import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue()], plugins: [vue()],
base: './', // 设置基础路径为 './' 表示相对路径
}) })

View File

@@ -1,4 +1,4 @@
import{m as et}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as et}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as f}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as f}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as l}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as l}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as s}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as s}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as lt}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as lt}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import{conf as t,language as e}from"./typescript-Ng0_s1ea.js";import"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{conf as t,language as e}from"./typescript-mPHwF3n0.js";import"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as Et}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as Et}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as l}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as l}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as s}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as s}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as o}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as o}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{t as O,m as I}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{t as O,m as I}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as s}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as s}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as r}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as r}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -1,4 +1,4 @@
import{m as l}from"./index-BrXGcXRv.js";/*!----------------------------------------------------------------------------- import{m as l}from"./index-DYZX9Lay.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
* Released under the MIT license * Released under the MIT license

View File

@@ -2,11 +2,11 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="./vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title> <title>Vite + Vue</title>
<script type="module" crossorigin src="/assets/index-BrXGcXRv.js"></script> <script type="module" crossorigin src="./assets/index-DYZX9Lay.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-sjOjmtig.css"> <link rel="stylesheet" crossorigin href="./assets/index-kHB7Hk61.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>