Lewati ke konten utama

getSlides

Dapatkan pohon slide blok sebagai array pre-order datar (hanya untuk slider_block).

Deskripsi

Metode ini mengembalikan slide dari blok slider sebagai array pre-order datar - setiap item membawa depth dan parentId-nya, sehingga Anda dapat membangun kembali pohon di klien. Ini hanya berfungsi untuk blok tipe slider_block. Metode ini mengembalikan Promise yang menyelesaikan menjadi objek IBlockSlidesResponse.

Blocks.getSlides(

marker*

);

Skema parameter

Skema

marker(diperlukan): string
Penanda blok
contoh: "slider_block"

Contoh

Contoh minimal

const response = await Blocks.getSlides('slider_block');

Contoh respons

{
"total": 1,
"items": [
{
"id": 1,
"parentId": null,
"depth": 0,
"position": 1,
"visible": true,
"attributeValues": {}
}
],
"time": 3,
"timeInterval": "sec"
}

Skema respons

Skema: IBlockSlidesResponse

total: number
Jumlah total slide.
contoh: 3

time: number
Waktu tampilan default untuk slide.
contoh: 5

timeInterval: 'sec' | 'ms'
Satuan dari field waktu.
contoh: "sec"

items: IBlockSlideItem[]
Array datar pre-order dari item slide.

items.id: number
Identifikasi slide.
contoh: 1

items.parentId: number | null
Identifikasi slide induk, atau null untuk slide akar.
contoh: null

items.depth: number
Kedalaman slide dalam pohon.
contoh: 0

items.position: number
Posisi slide di antara saudara-saudaranya.
contoh: 1

items.visible: boolean
Apakah slide terlihat.
contoh: true

items.time: number
Waktu tampilan untuk slide.
contoh: 5

items.timeInterval: 'sec' | 'ms'
Satuan dari field waktu.
contoh: "sec"

items.attributeValues: IAttributeValues
Peta nilai atribut yang dikunci oleh penanda.