|
@@ -5,7 +5,7 @@ const buttons_tpl = `
|
|
|
<div class="form-group">
|
|
|
{{#label}}<label>{{label}}</label> <br> {{/label}}
|
|
|
{{#buttons}}
|
|
|
- <button type="{{btn_type}}" data-type="{{type}}" aria-describedby="{{name}}_help" {{#disabled}}disabled data-pywebio-disabled{{/disabled}} class="btn btn-primary">{{label}}</button>
|
|
|
+ <button type="{{btn_type}}" data-type="{{type}}" aria-describedby="{{name}}_help" {{#disabled}}disabled data-pywebio-disabled{{/disabled}} class="btn btn-{{color}}">{{label}}</button>
|
|
|
{{/buttons}}
|
|
|
<div class="invalid-feedback">{{invalid_feedback}}</div> <!-- input 添加 is-invalid 类 -->
|
|
|
<div class="valid-feedback">{{valid_feedback}}</div> <!-- input 添加 is-valid 类 -->
|
|
@@ -24,6 +24,7 @@ export class Actions extends InputItem {
|
|
|
create_element(): JQuery {
|
|
|
for (let b of this.spec.buttons) b['btn_type'] = b.type === "submit" ? "submit" : "button";
|
|
|
|
|
|
+ this.spec.color = "primary"; // default button color
|
|
|
const html = Mustache.render(buttons_tpl, this.spec);
|
|
|
this.element = $(html);
|
|
|
let btns = this.element.find('button');
|