Doc: update
This commit is contained in:
parent
3405fb7e8a
commit
7354bec8fd
@ -5,6 +5,12 @@
|
|||||||
Fix:
|
Fix:
|
||||||
|
|
||||||
> 1.Fix the issue where the style of the collapsed nodes remains unchanged when switching themes;
|
> 1.Fix the issue where the style of the collapsed nodes remains unchanged when switching themes;
|
||||||
|
>
|
||||||
|
> 2.Fix the issue of losing the new text style when switching themes for text wrapping;
|
||||||
|
>
|
||||||
|
> 3.Fix the issue where the style of the newline text remains unchanged when switching themes;
|
||||||
|
>
|
||||||
|
> 4.Fixed the issue of adding mathematical formulas to nodes and not changing the text style when switching themes;
|
||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
@ -23,6 +29,10 @@ Demo:
|
|||||||
> 2.Support setting the position of node arrow display;
|
> 2.Support setting the position of node arrow display;
|
||||||
>
|
>
|
||||||
> 3.Support setting the starting position of root node connections;
|
> 3.Support setting the starting position of root node connections;
|
||||||
|
>
|
||||||
|
> 4.Add two new themes;
|
||||||
|
>
|
||||||
|
> 5.Fix the issue of text wrapping not taking effect in the outline and displaying the br tag;
|
||||||
|
|
||||||
## 0.9.5
|
## 0.9.5
|
||||||
|
|
||||||
|
|||||||
@ -469,6 +469,16 @@ Convert to:
|
|||||||
|
|
||||||
Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.
|
Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.
|
||||||
|
|
||||||
|
#### removeHtmlNodeByClass(html, selector)
|
||||||
|
|
||||||
|
> v0.9.6+
|
||||||
|
|
||||||
|
- `html`:html string
|
||||||
|
|
||||||
|
- `selector`:Node selectors, such as class selectors and id selectors
|
||||||
|
|
||||||
|
Remove the node of the specified selector from the specified HTML string, and then return the processed HTML string.
|
||||||
|
|
||||||
## Simulate CSS background in Canvas
|
## Simulate CSS background in Canvas
|
||||||
|
|
||||||
Import:
|
Import:
|
||||||
|
|||||||
@ -5,6 +5,12 @@
|
|||||||
修复:
|
修复:
|
||||||
|
|
||||||
> 1.修复切换主题时,被收起的节点样式没有改变的问题;
|
> 1.修复切换主题时,被收起的节点样式没有改变的问题;
|
||||||
|
>
|
||||||
|
> 2.修复切换主题后进行文本换行时,新换行的文本样式会丢失的问题;
|
||||||
|
>
|
||||||
|
> 3.修复切换主题时,换行的文本样式没有改变的问题;
|
||||||
|
>
|
||||||
|
> 4.修复添加了数学公式的节点,切换主题时文本样式没有改变的问题;
|
||||||
|
|
||||||
新增:
|
新增:
|
||||||
|
|
||||||
@ -23,6 +29,10 @@ Demo:
|
|||||||
> 2.支持设置节点箭头显示的位置;
|
> 2.支持设置节点箭头显示的位置;
|
||||||
>
|
>
|
||||||
> 3.支持设置根节点连线的起始位置;
|
> 3.支持设置根节点连线的起始位置;
|
||||||
|
>
|
||||||
|
> 4.新增两个主题;
|
||||||
|
>
|
||||||
|
> 5.修复大纲中文本换行不生效,显示br标签的问题;
|
||||||
|
|
||||||
## 0.9.5
|
## 0.9.5
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,15 @@ import {walk, ...} from 'simple-mind-map/src/utils'
|
|||||||
示例:
|
示例:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
walk(tree, null, () => {}, () => {}, false, 0, 0)
|
walk(
|
||||||
|
tree,
|
||||||
|
null,
|
||||||
|
() => {},
|
||||||
|
() => {},
|
||||||
|
false,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### bfsWalk(root, callback)
|
#### bfsWalk(root, callback)
|
||||||
@ -137,7 +145,9 @@ copyNodeTree({}, node)
|
|||||||
测量文本的宽高,返回值:
|
测量文本的宽高,返回值:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{ width, height }
|
{
|
||||||
|
width, height
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### getTextFromHtml(html)
|
#### getTextFromHtml(html)
|
||||||
@ -173,8 +183,7 @@ copyNodeTree({}, node)
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
width,
|
width, height
|
||||||
height
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -386,8 +395,7 @@ copyNodeTree({}, node)
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
text,
|
text, img
|
||||||
img
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -448,7 +456,9 @@ copyNodeTree({}, node)
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
转为:
|
转为:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
uid: {
|
uid: {
|
||||||
@ -464,6 +474,16 @@ copyNodeTree({}, node)
|
|||||||
|
|
||||||
将平级对象转树结构。transformTreeDataToObject 方法的反向操作。
|
将平级对象转树结构。transformTreeDataToObject 方法的反向操作。
|
||||||
|
|
||||||
|
#### removeHtmlNodeByClass(html, selector)
|
||||||
|
|
||||||
|
> v0.9.6+
|
||||||
|
|
||||||
|
- `html`:html 字符串
|
||||||
|
|
||||||
|
- `selector`:节点选择器,比如类选择器,id 选择器
|
||||||
|
|
||||||
|
去除指定 html 字符串中指定选择器的节点,然后返回处理后的 html 字符串。
|
||||||
|
|
||||||
## 在 canvas 中模拟 css 的背景属性
|
## 在 canvas 中模拟 css 的背景属性
|
||||||
|
|
||||||
引入:
|
引入:
|
||||||
@ -481,17 +501,24 @@ let img = '/1.jpg'
|
|||||||
let canvas = document.createElement('canvas')
|
let canvas = document.createElement('canvas')
|
||||||
canvas.width = width
|
canvas.width = width
|
||||||
canvas.height = height
|
canvas.height = height
|
||||||
drawBackgroundImageToCanvas(ctx, width, height, img, {
|
drawBackgroundImageToCanvas(
|
||||||
|
ctx,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
img,
|
||||||
|
{
|
||||||
backgroundRepeat: 'repeat-y',
|
backgroundRepeat: 'repeat-y',
|
||||||
backgroundSize: '60%',
|
backgroundSize: '60%',
|
||||||
backgroundPosition: 'center center'
|
backgroundPosition: 'center center'
|
||||||
}, (err) => {
|
},
|
||||||
|
err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
// 失败
|
// 失败
|
||||||
} else {
|
} else {
|
||||||
// 成功
|
// 成功
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
## LRU 缓存类
|
## LRU 缓存类
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user