Appearance
KBE3D / KBCore / utils / PopupOptions
接口: PopupOptions
弹窗实例类构造参数类型
属性
id?
optionalid:string
id标识,默认为随机uuid
direction?
optionaldirection:"right"|"left"|"bottom"|"top"
方向,默认为'top',代表上边
contentType?
optionalcontentType:"html"|"component"
内容类型,默认为'html' 当设置为'html'时,代表采用html模板或html字符串或普通字符串渲染popup窗口,如需使用模板字符串,请同时配置htmlTemplate参数 当设置为'component'时,代表采用自定义组件渲染popup窗口,请务必同时配置componentElement参数,并在component组件中通过popup实例自行实现显隐控制和数据展示等功能
htmlTemplate?
optionalhtmlTemplate:string
当contentType为'html'时,所需的html模板字符串
示例
- 模板示例
html
<div>
<tr>
<td>表头A</td>
<td>表头B</td>
<td>表头D</td>
</tr>
<tr>
<td>内容:{{A}}</td>
<td>内容:{{B}}</td>
<td>内容:{{C.D}}</td>
</tr>
</div>- 数据示例
ts
const data = {
A: '这是A',
B: '这是B',
C: {
D: '这是D'
}
}- 执行:
popup.open(data)渲染结果为:
html
<div>
<tr>
<td>表头A</td>
<td>表头B</td>
<td>表头D</td>
</tr>
<tr>
<td>内容:这是A</td>
<td>内容:这是B</td>
<td>内容:这是D</td>
</tr>
</div>componentElement?
optionalcomponentElement:HTMLElement
当contentType为'component'时,所需的组件的根dom元素
entity?
optionalentity:boolean|Entity|ConstructorOptions
Cesium图标标注,可以是Cesium.Entity对象或Cesium.Entity的构造参数对象或布尔类型 设置为Entity对象或构造参数对象,则使用用户自定义Entity 设置为true则使用内置默认的billboard图标标注 不传值或设置为false,则不创建图标标注
emptyText?
optionalemptyText:string
当没有数据时显示的文字,默认显示"暂无数据"
