使用 Oraclejet 框架,我试图制作一个只有 2 个选项的拆分按钮。我怎样才能区分它们,以便每个都有自己的功能?或者如何粘贴 selected 的文本作为参数?
是这样的
<div id="dialogWrapper" style="position:relative; max-height:1%; max-width:1%;">
<button id="printPdf" style="margin-right:6px;"data-bind="
ojComponent: {component: 'ojButton',
menu:'#choices'
}"/>
里面的菜单:
<ul id="choices" style="display:none"
data-bind="ojComponent: {component: 'ojMenu', select: print//here both of them call to same function}">
<li id="PDF">
a href="#"><span class=""></span>PDF</a>
</li>
<li id="Excel">
<a href="#"><span class=""></span>Excel</a>
</li>
</ul>
</div>