Skip to main content

Select

Setting type select xuất ra các trường bộ chọn khác nhau, tùy thuộc vào các tiêu chí nhất định. Ngoài các thuộc tính Standard attributes của cài đặt đầu vào, cài đặt loại chọn có các thuộc tính sau:

NamedescriptionRequired
deviceEnabledTurn on multiple devicesno
optionsTakes an array of value/label definitions for each option in the drop-down.no

Setting

    {
id: "select",
type: "select",
deviceEnabled: true,
label: "select",
options: [
{
label: "Label 1",
value: "value_1",

},
{
label: "Label 2",
value: "value_2",

},
],
default: {
desktop: "value_1",
},
},

Giao diện

alt

When accessing the value of a select type setting, data is returned as one of the following:

{settings.select}

Output

Ví dụ

  • Nếu deviceEnabled :true
{
"desktop": "value_1",
"tablet": "value_2"
}

-Nếu deviceEnabled:false

"value_1"