diff --git a/docs/api/editor/props.md b/docs/api/editor/props.md index decf753b..73144703 100644 --- a/docs/api/editor/props.md +++ b/docs/api/editor/props.md @@ -375,7 +375,7 @@ const stageContentMenu = ref([ ```html ``` diff --git a/docs/guide/advanced/page.md b/docs/guide/advanced/page.md index a0b7fd69..6945a0e6 100644 --- a/docs/guide/advanced/page.md +++ b/docs/guide/advanced/page.md @@ -60,6 +60,5 @@ export default defineComponent({ ## 渲染器示例 在tmagic-editor的示例项目中,我们提供了三个版本的 @tmagic/ui。可以参考对应前端框架的渲染器实现。 -- [vue3 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui/src/container/src/Container.vue) -- [vue2 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-vue2/src/container/Container.vue) -- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react/src/container/Container.tsx) \ No newline at end of file +- [vue 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/vue-components/container/src/Container.vue) +- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/react-components/container/src/Container.tsx) \ No newline at end of file diff --git a/docs/guide/advanced/tmagic-ui.md b/docs/guide/advanced/tmagic-ui.md index c79f14e6..7c124abe 100644 --- a/docs/guide/advanced/tmagic-ui.md +++ b/docs/guide/advanced/tmagic-ui.md @@ -5,15 +5,13 @@ tmagic-editor的设计是希望发布的页面支持多个前端框架,即各 所以tmagic-editor的设计中,针对每个前端框架,都需要有一个对应的 @tmagic/ui 来承担渲染器职责。同时,也需要一个使用和 @tmagic/ui 相同前端框架的 runtime 来 @tmagic/ui 和业务组件的,具体 runtime 概念,可以参考[页面发布](../publish)。 -@tmagic/ui 在tmagic-editor设计中,承担的是业务逻辑无关的,基础组件渲染的功能。一切和业务相关的逻辑,都应该在 [runtime](../runtime.html) 中实现。这样 @tmagic/ui 就能保持其通用性。 - -我们以项目代码中提供的 vue3 版本的 @tmagic/ui 作为示例介绍其中包含的内容。 +我们以项目代码中提供的 vue 版本的 [vue-components](https://tencent.github.io/tmagic-editor/vue-components) 作为示例介绍其中包含的内容。 ## 渲染器 -在 vue3 中,实现渲染器的具体形式参考[页面渲染](../advanced/page)中描述的[容器渲染](../advanced/page.html#容器渲染)和[组件渲染](../advanced/page.html#容器渲染)。 +在 vue 中,实现渲染器的具体形式参考[页面渲染](../advanced/page)中描述的[容器渲染](../advanced/page.html#容器渲染)和[组件渲染](../advanced/page.html#容器渲染)。 ## 基础组件 -在 @tmagic/ui vue3 中,我们提供了几个基础组件,可以在项目源码中找到对应内容。 +在 [vue-components](https://tencent.github.io/tmagic-editor/vue-components) 中,我们提供了几个基础组件,可以在项目源码中找到对应内容。 - page tmagic-editor的页面基础 - container tmagic-editor的容器渲染器 @@ -23,8 +21,3 @@ tmagic-editor的设计是希望发布的页面支持多个前端框架,即各 其中 page/container/Component 是 UI 的基础,是每个框架的 UI 都应该实现的。 button/text 其实就是一个组件开发的示例,具体组件开发相关规范可以参考[组件开发](../component)。 - -## @tmagic/ui 示例 -- [vue3 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui) -- [vue2 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-vue2) -- [react 渲染器](https://github.com/Tencent/tmagic-editor/blob/master/packages/ui-react) \ No newline at end of file diff --git a/docs/guide/component.md b/docs/guide/component.md index 28df7b2c..af80d0d1 100644 --- a/docs/guide/component.md +++ b/docs/guide/component.md @@ -2,14 +2,14 @@ tmagic-editor支持业务方进行自定义组件开发。在tmagic-editor中,组件是以 npm 包形式存在的,组件和插件只要按照规范开发,就可以在tmagic-editor的 runtime 中被加入并正确渲染组件。 ## 组件开发 -以 vue3 的组件开发为例。运行项目中的 playground 示例,会自动加载 vue3 的 runtime。runtime会加载[@tmagic/ui](https://github.com/Tencent/tmagic-editor/tree/master/packages/ui) +以 vue 的组件开发为例。运行项目中的 playground 示例,会自动加载 vue 的 runtime。runtime会加载[@tmagic/ui](https://github.com/Tencent/tmagic-editor/tree/master/packages/ui) ## 组件注册 在 [playground](https://tencent.github.io/tmagic-editor/playground/index.html#/) 中,我们可以尝试点击添加一个组件,在模拟器区域里,就会出现这个组件。其中就涉及到组件注册。 这一步需要开发者基于tmagic-editor搭建了平台后,实现组件列表的注册、获取机制,tmagic-editor组件注册其实就是保存好组件 `type` 的映射关系。`type` 可以参考[组件介绍](../guide/conception.html#组件)。 -可以参考 vue3 版本的 @tmagic/ui 中,[组件渲染](../guide/advanced/page.html#组件渲染)逻辑里,type 会作为组件名进入渲染。所以在 vue3 的组件开发中,我们也需要在为 vue 组件声明 name 字段时,和 type 值对应起来,才能正确渲染组件。 +可以参考 vue 版本的 @tmagic/ui 中,[组件渲染](../guide/advanced/page.html#组件渲染)逻辑里,type 会作为组件名进入渲染。所以在 vue 的组件开发中,我们也需要在为 vue 组件声明 name 字段时,和 type 值对应起来,才能正确渲染组件。 ### 组件规范 组件的基础形式,需要有四个文件 @@ -22,7 +22,7 @@ tmagic-editor支持业务方进行自定义组件开发。在tmagic-editor中, @tmagic/ui 中的 button/text 就是基础的组件示例。我们要求声明 index 入口,因为我们希望在后续的配套打包工具实现上,可以有一个统一规范入口。 ### 1. 创建组件 -在项目中,如 runtime vue3 目录中,创建一个名为 test-component 的组件目录,其中包含上面四个规范文件。 +在项目中,如 runtime 目录中,创建一个名为 test-component 的组件目录,其中包含上面四个规范文件。 ```javascript // index.js // vue @@ -69,7 +69,7 @@ export default { }; ``` -vue3 版本的组件代码示例 + 版本的组件代码示例 ```vue