按钮
要显示按钮,我们使用组件button。
JUI中的按钮组件表示html <button/>
。
const buttonJSON = {
"component": "button",//tells the component name
"label": "Yes, login",//tells the text for the button
"variant": "cta",//tells the variants for the button which provides default styles
"on-click": "done",//tells what function to run after user clicks the button
};
这将生成一个标签为Yes, login
的按钮。 其他属性包括但不限于variant、label、on-click。
注意:
on-<events>
是调用控制器中命令的语法。
呈现的按钮将如下所示:
recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178