API Reference > @next-core/brick-kit > property
property() function
构件属性装饰器。
Signature:
export declare function property(options?: PropertyDeclaration): any;
Parameters
| Parameter | Type | Description |
|---|---|---|
| options | PropertyDeclaration | 构件属性的选项。 |
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;
}