簡體   English   中英

CKEditor選擇元素:如何添加鍵值對

[英]CKEditor select element: how to add key value pairs

文檔所述 ,為了添加帶有某些元素的選擇,您需要添加以下內容:

{
    id: 'my-element-id',
    type: 'select',
    label: 'My element',
    items: [ [ 'Value1' ], [ 'Value2'  ], [ 'Value3'  ], [ 'Value4' ] ]
},

但是這樣Value1,Value2等都是鍵和值。

如何添加選擇區分鍵和值?

到目前為止,我的解決方案是:

{
    id: 'my-element-id',
    type: 'select',
    label: 'My Element Label',
    items: [ [ 'Label1', 'Value1' ], [ 'Label2', 'Value2'  ], [ 'Label3', 'Value3'  ], [ 'Label4', 'Value4' ] ]
},

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM