mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-20 21:19:29 +08:00
docs: 完善快速开始实例代码
This commit is contained in:
parent
591c4d05b2
commit
9de04ddaa4
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,4 +29,4 @@ coverage
|
|||||||
|
|
||||||
auto-imports.d.ts
|
auto-imports.d.ts
|
||||||
components.d.ts
|
components.d.ts
|
||||||
docs/.vitepress/cache/deps
|
docs/.vitepress/cache
|
||||||
|
@ -121,6 +121,14 @@ app.mount("#app");
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
html, body {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -138,6 +146,30 @@ app.mount("#app");
|
|||||||
|
|
||||||
其中,**有四个需要注意的属性配置项**:`runtimeUrl` `values` `configs` `componentGroupList`。这是能让我们的编辑器正常运行的关键。
|
其中,**有四个需要注意的属性配置项**:`runtimeUrl` `values` `configs` `componentGroupList`。这是能让我们的编辑器正常运行的关键。
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
如果出现```Preprocessor dependency "sass" not found. Did you install it?```,那么需要install sass
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install sass -D
|
||||||
|
```
|
||||||
|
:::
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
如果是使用vite构建工具,如果出现 ```Uncaught ReferenceError: global is not defined```,那么需要再vite.config.js中添加如下配置:
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
optimizeDeps: {
|
||||||
|
esbuildOptions: {
|
||||||
|
define: {
|
||||||
|
global: 'globalThis',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
:::
|
||||||
|
|
||||||
## runtimeUrl
|
## runtimeUrl
|
||||||
|
|
||||||
该配置涉及到 [runtime 概念](runtime.md),tmagic-editor编辑器中心的模拟器画布,是一个 iframe(这里的 `runtimeUrl` 配置的,就是你提供的 iframe 的 url),其中渲染了一个 runtime,用来响应编辑器中的组件增删改等操作。
|
该配置涉及到 [runtime 概念](runtime.md),tmagic-editor编辑器中心的模拟器画布,是一个 iframe(这里的 `runtimeUrl` 配置的,就是你提供的 iframe 的 url),其中渲染了一个 runtime,用来响应编辑器中的组件增删改等操作。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user