docs/api/trait.md
id String Trait id, eg. my-trait-id.type String Trait type, defines how the trait should be rendered. Possible values: text (default), number, select, checkbox, color, buttonlabel String The trait label to show for the rendered trait.name String The name of the trait used as a key for the attribute/property. By default, the name is used as attribute name or property in case changeProp in enabled.default String Default value to use in case the value is not defined on the component.placeholder String Placeholder to show inside the default input (if the UI type allows it).category String? Trait category.changeProp Boolean If true, the trait value is applied on the component property, otherwise, on component attributes.Get the trait id.
Returns String
Get the trait type.
Returns String
Get the trait name.
Returns String
Get the trait label.
opts Object Options. (optional, default {})
opts.locale Boolean Use the locale string from i18n module. (optional, default true)Returns String
Get the trait value.
The value is taken from component attributes by default or from properties if the trait has the changeProp enabled.
opts Object Options. (optional, default {})
opts.useType Boolean Get the value based on type (eg. the checkbox will always return a boolean). (optional, default false)Returns any
Update the trait value.
The value is applied on component attributes by default or on properties if the trait has the changeProp enabled.
value any Value of the trait.
opts Object Options. (optional, default {})
opts.partial Boolean? If true the update won't be considered complete (not stored in UndoManager).Get default value.
Get trait options.
Returns Array<TraitOption>
Get current selected option or by id.
id String? Option id.Returns (Object | null)
Get the option id from the option object.
option Object Option objectReturns String Option id
Get option label.
opts Object Options (optional, default {})
opts.locale Boolean Use the locale string from i18n module (optional, default true)Returns String Option label
Get category label.
opts Object Options. (optional, default {})
opts.locale Boolean Use the locale string from i18n module. (optional, default true)Returns String
Run the trait command (used on the button trait type).