拓展 / GraphUI / EmptyStateOptions
接口: EmptyStateOptions
UI.emptyState:空白画布显示的卡片。
该卡是点击式的,因此平移和画布菜单可以对其进行操作,但其中的交互式内容(按钮、链接、表单控件、带有 tabindex 的任何内容)除外,这些内容会接收自己的点击。
示例
js
UI: {
emptyState: {
render: ({ initial }) => {
const box = document.createElement('div')
box.textContent = initial ? 'Nothing is related to this record.' : 'The canvas is empty.'
return box
},
},
}延伸
属性
enabled?
optionalenabled:boolean
默认值
ts
true继承自
render?
optionalrender:string|HTMLElement| (ctx) =>RenderResult
卡的内容。每次卡片出现时都运行,而不是在卡片启动时每次更改时运行,因此一旦图表包含一个节点,它就可以说不同的内容。返回的 string 呈现为纯文本;返回 HTMLElement 来呈现您自己的标记。可能是async。
默认值
ts
'Nothing on the canvas yet'