我有库标签输入,我想返回标签的 ID(由用户添加)。在 window.acNodes.ttAdapter 中是具有 id 和 value 但在输入中只有 value 的数组。我怎样才能获得 id?
elt.tagsinput({
itemValue: 'value',
itemText: 'value',
typeaheadjs: {
name: 'value',
displayKey: 'value',
templates: {
empty: [
'<p>Could not find this word.</p>'
].join('\n'),
suggestion: Handlebars.compile("<p><strong>{{value}}</strong> <div style='font-size:12px;'>#{{id}} {{author_name}}</div></p>")
},
source: window.acNodes.ttAdapter()
}
});
tagsinput 有方法 items() 但没有返回如何处理这个问题?