Nhảy đến nội dung

getSingleAttributeByMarkerSet

Lấy một thuộc tính với dữ liệu từ bộ thuộc tính.

Mô tả

Phương thức này trả về một thuộc tính đơn lẻ với dữ liệu từ các bộ thuộc tính. Nó trả về một Promise mà khi hoàn thành sẽ trả về một đối tượng IAttributesSetsEntity.

AttributesSets.getSingleAttributeByMarkerSet(

setMarker, attributeMarker, langCode

);

Sơ đồ tham số

Sơ đồ

setMarker(bắt buộc): string
Định danh văn bản (marker) của bộ thuộc tính
ví dụ: "productAttributes"

attributeMarker(bắt buộc): string
Định danh văn bản (marker) của thuộc tính trong bộ
ví dụ: "color"

langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"

Ví dụ

Ví dụ tối thiểu

const response = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1');

Ví dụ với thuộc tính langCode

const response = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1', 'en_US');

Ví dụ phản hồi

{
"type": "string",
"value": {},
"marker": "admin-text",
"position": 1,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "Văn bản Admins"
},
"additionalFields": []
}

Sơ đồ phản hồi

Sơ đồ: IAttributesSetsEntity

type: AttributeType
Loại thuộc tính.
ví dụ: "string", "text", "integer", "v.v."

value: any
Giá trị của thuộc tính, có thể là bất kỳ loại nào.

marker: string
Định danh văn bản của thuộc tính (marker).
ví dụ: "color", "size", "v.v."

position: number
Số thứ tự để sắp xếp.
ví dụ: 1

listTitles: IListTitle[] | Record<string, any>
Mảng các giá trị (với dữ liệu mở rộng) cho thuộc tính danh sách và radioButton.
ví dụ:

[
{
"title": "red",
"value": 1,
"position": 1,
"extendedValue": null,
"extendedValueType": null
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extendedValue": null,
"extendedValueType": null
}
]

validators: Record<string, any>
Tập hợp các bộ xác thực cho việc xác thực.
ví dụ:

{
"requiredValidator": {
"strict": true
},
"defaultValueValidator": {
"fieldDefaultValue": 11
}
}

localizeInfos: ILocalizeInfo
Tên của mẫu, tính đến việc địa phương hóa.
ví dụ:

{
"title": "Thuộc tính của tôi"
}

additionalFields: Record<string, any>
Các trường bổ sung cho thuộc tính (tùy chọn).

settings: Record<string, any>
Cài đặt thuộc tính bổ sung (tùy chọn).