我很难弄清楚如何让这个下拉列表真正起作用。按钮呈现正常,但不会下拉。关于我在这里缺少什么的想法?很确定我需要一个onClick功能,但不知道控制什么来让它下拉。
var Dropdownbutton = React.createClass({
displayName: 'Dropdownbutton',
render: function() {
return el.div(null,
el.div({className: 'col-xs-12 col-md-6 col-lg-3'},
el.div({className:'btn-group'},
el.a({href:'#',className:'btn btn-primary'},'Primary'),
el.a({href:'#',className:'btn btn-primary dropdown-toggle', "data-toggle":'dropdown'},el.span({className:'caret'},'')),
el.ul({className:'dropdown-menu'},
el.li(null,el.a({href:'#'},'Action')),
el.li(null,el.a({href:'#'},'Another action')),
el.li(null,el.a({href:'#'},'Something else here')),
el.li({className:'divider'},''),
el.li(null,el.a({href:'#'},'Separated link'))
)
)
)
);
}
});
答案 0 :(得分:0)
据我所知,你没有上课下拉。对代码稍作修改应该有效。
var Dropdownbutton = React.createClass({
displayName: 'Dropdownbutton',
render: function() {
return el.div(null,
el.div({className: 'dropdown col-xs-12 col-md-6 col-lg-3'},
el.div({className:'btn-group'},
el.a({href:'#',className:'btn btn-primary'},'Primary'),
el.a({href:'#',className:'btn btn-primary dropdown-toggle', "data-toggle":'dropdown'},el.span({className:'caret'},'')),
el.ul({className:'dropdown-menu'},
el.li(null,el.a({href:'#'},'Action')),
el.li(null,el.a({href:'#'},'Another action')),
el.li(null,el.a({href:'#'},'Something else here')),
el.li({className:'divider'},''),
el.li(null,el.a({href:'#'},'Separated link'))
)
)
)
);
}
});