API Reference / api/form/Form / Form
Class: Form
Defined in: api/form/Form.d.ts:8
该类表示一个通用表单。 Form类提供了一个不同的类型的表单的基抽象,支持三种类型:Action、Message和Modal。每个表单都有一个标题,可以是一个字符串或一个可翻译对象。
Extended by
Methods
getTitle()
ts
getTitle(): string
Defined in: api/form/Form.d.ts:14
获取表单的标题。
Returns
string
表单的标题。
setOnClose()
ts
setOnClose(on_close): this
Defined in: api/form/Form.d.ts:30
设置表单关闭时的回调函数。
Parameters
on_close
(player
) => void
回调函数要设置为。
Returns
this
当前表单的引用。
setTitle()
ts
setTitle(title): this
Defined in: api/form/Form.d.ts:22
设置表单的标题。
Parameters
title
string
要设置为表单的标题,可以是字符串或一个可翻译对象。
Returns
this
当前表单的引用。