Skip to main content
Version: 2.x

API Reference > @next-core/brick-kit > property

property() function

构件属性装饰器。

Signature:

export declare function property(options?: PropertyDeclaration): any;

Parameters

ParameterTypeDescription
optionsPropertyDeclaration构件属性的选项。

Returns:

any

Example

class MyBrickElement extends UpdatingElement {
@property()
myStringProp: string;

@property({ type: Number })
myNumberProp: number;

@property({ type: Boolean })
myBooleanProperty: boolean;

@property({ attribute: false })
myComplexProperty: MyComplexInterface;
}