FieldImage 类
用于块上的图片的类。
Signature:
export declare class FieldImage extends Field<string>
扩展:Field<string>
构造函数
构造函数 | 修饰符 | 说明 |
---|---|---|
(constructor)(src, width, height, alt、onClick、flipRtl, config) | 构造 FieldImage 类的新实例 |
属性
媒体资源 | 修饰符 | 类型 | 说明 |
---|---|---|---|
可修改 | readonly |
(未声明) | 可修改字段通常会显示某种界面,表明这些字段是可修改的。此字段不应填写。 |
imageElement | protected |
SVGImageElement | null | 所渲染字段的图片元素。 |
imageHeight |
|
number | |
isDirty_ | protected |
boolean | 用于指示下次渲染块时是否需要渲染字段。Image 字段的大小是静态的,并且只需要在初始化时渲染。 |
size_ | protected |
尺寸 |
方法
方法 | 修饰符 | 说明 |
---|---|---|
configure_(config) | protected |
根据指定的选项映射配置该字段。 |
doClassValidation_(newValue) | protected |
确保输入值(来源网址)是字符串。 |
doValueUpdate_(newValue) | protected |
更新此图片字段的值,并更新显示的图片。 |
getFlipRtl() | 获取是否按 RTL 方向翻转此图片 | |
getText_() | protected |
使用 getText_ 开发者钩子替换字段的文本表示形式。请改为返回图片替代文本。 |
initView() | 为此图像创建块界面。 | |
setAlt(Alt) | 设置此图片的替代文本。 | |
setOnClickHandler(func) | 设置点击此图片时调用的函数。 | |
showEditor_() | protected |
如果调用了字段点击,并定义了点击处理程序,则调用该处理程序。 |
updateSize_() |