mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Feat:addContentToHeader方法支持返回空数据
This commit is contained in:
@@ -309,7 +309,7 @@ export const defaultOpt = {
|
||||
*/
|
||||
},
|
||||
// 导出png、svg、pdf时在头部和尾部添加自定义内容
|
||||
// 可传递一个函数,这个函数需要返回如下数据:
|
||||
// 可传递一个函数,这个函数可以返回null代表不添加内容,也可以返回如下数据:
|
||||
/*
|
||||
{
|
||||
el,// 要追加的自定义DOM节点,样式可内联
|
||||
|
||||
@@ -1330,7 +1330,9 @@ export const handleGetSvgDataExtraContent = ({
|
||||
let footerHeight = 0
|
||||
const handle = (fn, callback) => {
|
||||
if (typeof fn === 'function') {
|
||||
const { el, cssText, height } = fn()
|
||||
const res = fn()
|
||||
if (!res) return
|
||||
const { el, cssText, height } = res
|
||||
if (el instanceof HTMLElement) {
|
||||
el.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
|
||||
const foreignObject = new ForeignObject()
|
||||
|
||||
Reference in New Issue
Block a user