Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
YouYe committed May 16, 2022
1 parent bde2465 commit a862915
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 14,111 deletions.
17 changes: 7 additions & 10 deletions docs/.vuepress/config/locales/zh/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,22 @@ module.exports = {
collapsable: false
},
{
title: "进阶",
path: "/zh/flyfish/advanced/component",
collapsable: false,
children: ["advanced/component", "advanced/screen"]
},
{
title: "自定义",
title: "组件基础",
path: "/zh/flyfish/component/basic",
collapsable: false,
children: [
"component/basic",
"component/develop",
"component/create",
"component/related",
"component/react",
"component/event",
"component/upload"
]
},
{
title: "进阶",
path: "/zh/flyfish/advanced/component",
collapsable: false,
children: ["advanced/component", "advanced/screen"]
},
{
title: "常见问题解答",
path: "/zh/flyfish/faq",
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/flyfish/advanced/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 进阶
prev: ../case
next: ./component
prev: ../component/basic
next: ../fag
---

进阶主要包含两个部分:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/flyfish/advanced/screen.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 大屏进阶
prev: ./component
next: ../component/basic
next: ../component
---

## 创建一个大屏
Expand Down
9 changes: 4 additions & 5 deletions docs/zh/flyfish/component/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
title: 进阶
prev: ../advanced/component
next: ../getting-started/
title: 组件基础
prev: ../case
next: ../advanced/component
---

组件主要包含七个部分:
组件主要包含六个部分:

- 构成
- 开发
- 创建
- 基础
- react
- 通信
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/flyfish/component/basic.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 组件构成
prev: ../advanced/component
prev: ../case
next: ./develop
---

Expand Down
22 changes: 0 additions & 22 deletions docs/zh/flyfish/component/create.md

This file was deleted.

29 changes: 3 additions & 26 deletions docs/zh/flyfish/component/develop.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
---
title: 组件开发
prev: ./basic
next: ./create
next: ./related
---

目前我们有两种组件开发方式

## 在线开发

直接在[组件开发平台](http://10.0.16.230:8089/#/app/component-develop)进行组件开发。该平台提供了在线 ide 和实时预览大屏。
直接在飞鱼平台进行组件开发。该平台提供了在线 ide 和实时预览大屏。

## 本地开发

本地开发可使用两种种形式进行(请提前确认都拥有 clone 对应仓库的权限)

1. 直接 clone 对应仓库

```bash
$ git clone ssh://[email protected]:36000/FlyFish/component-develop.git
$ Cloning into 'ff-component-develop'...
```

3. 可使用 VIS-Editor 和 VIS-Screen 直接进行本地开发(飞鱼开发者)

## FAQ

### 1. 组件开发平台账号如何获取?

可以直接和对应的开发者进行申请。

### 2. 为什么指定下载器为`yarn`

由于我们的本地组件开发模板使用`lerna + workspace`来管理依赖和包。这样做的好处是可以将所有子包的依赖管理在一个`node_modules`中。因为我们的组件是独立的存在,每个组件都可能会拥有自己的依赖,这样就会存在复合的依赖。从而使本地开发变得冗余且沉重。使用`workspace + lerna`可以完美解决当前的问题。当然还能解决组件间的相互引用依赖问题。因为`lerna`会自动执行`link`的操作。

### 3. 为什么子包中还是会出现`node_modules`?

`lerna`虽然可以帮我们把所有子包的依赖进行统一管理。但是若某些子包使用相同依赖不同版本时,这时底层`node_modules`只会安装先匹配的子包的依赖版本, 后面子包会维护在自己独立的`node_modules`里。毕竟依赖查询是个向上溯源的过程
本地开发库暂未开源,敬请期待。
2 changes: 1 addition & 1 deletion docs/zh/flyfish/component/event.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 组件通信
prev: ./react
next: ./upload
next: ../advanced/component
---

::: tip
Expand Down
118 changes: 0 additions & 118 deletions docs/zh/flyfish/component/react.md

This file was deleted.

43 changes: 4 additions & 39 deletions docs/zh/flyfish/component/related.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 组件基础
next: ./react
prev: ./related
title: 组件
next: ./event
prev: ./develop
---

::: tip
Expand Down Expand Up @@ -138,39 +138,4 @@ prev: ./related
| \_redraw | redraw | 重绘数据时调用 |
| \_normalize | normalize | 获取标准化数据时调用 |
| \_destroy | destroy | 组件销毁时调用 |
| \_connectTo | - | 联动事件发生时, 获取变量值的钩子方法 |

## FAQ

### 1. 大屏和组件是如何关联的?

在初始创建大屏时,初始化的组件是由初始化选择的标签决定,会拉取对应标签下关联的所有组件来作为大屏编辑时的组件。

### 2. 若编辑大屏之后,其中一些组件更改了标签,会影响已编辑的大屏二次编辑吗?

不会。因为大屏的配置文件中还会留存对应使用组件的 map, 并不会受到当前组件标签更改的影响。不过在上面的预备组件中无法再次拖入大屏中使用而已。

### 3. 为什么数据源(`dataConfig`)需要一个`mapping`?

数据配置中的`mapping`, 顾名思义, `mapping`是用来做字段映射的. 在很多情况下,组件必须要做一个映射, 才能识别数据结构, 所以在组件内部, 默认增加了`mapping`的支持.下面一个示例:

```js
// 数据
[
{
content: "这是一串文本, 我想用文本组件显示出来"
}
];
// 对应的`dataConfig`
{
mapping: {
text: "content";
}
}
// 组件侧读取
data[0].text;
```

---

> 主要内容来自[传送门](https://git.cloudwise.com/FlyFish/VIS-Screen/-/blob/master/document/%E7%BB%84%E4%BB%B6%E7%9A%84%E5%BC%80%E5%8F%91.md)
| \_connectTo | - | 联动事件发生时, 获取变量值的钩子方法 |
Loading

0 comments on commit a862915

Please sign in to comment.