mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Merge 9ebc027333 into 9eab537b2e
This commit is contained in:
commit
bf33067aa8
@ -9,6 +9,13 @@ import { ForeignObject } from '@svgdotjs/svg.js'
|
||||
import merge from 'deepmerge'
|
||||
import { lineStyleProps } from '../theme/default'
|
||||
|
||||
// 可以在外部定义customFun,以实现自定义id生成规则
|
||||
export const createUidOption = {
|
||||
defaultFun: () => uuidv4(),
|
||||
customFun: null,
|
||||
}
|
||||
|
||||
|
||||
// 深度优先遍历树
|
||||
export const walk = (
|
||||
root,
|
||||
@ -484,7 +491,7 @@ export const getImageSize = src => {
|
||||
|
||||
// 创建节点唯一的id
|
||||
export const createUid = () => {
|
||||
return uuidv4()
|
||||
return (typeof createUidOption?.customFun === 'function') ? createUidOption.customFun() : createUidOption.defaultFun()
|
||||
}
|
||||
|
||||
// 加载图片文件
|
||||
|
||||
Loading…
Reference in New Issue
Block a user