|
11 | 11 | <div class="field-wrap">
|
12 | 12 | <component ref="child" :is="getFieldType(field)" :vfg="vfg" :disabled="fieldDisabled(field)" :model="model" :schema="field" :formOptions="options" @model-updated="onModelUpdated" @validated="onFieldValidated"></component>
|
13 | 13 | <div v-if="buttonVisibility(field)" class="buttons">
|
14 | | - <button v-for="(btn, index) in field.buttons" @click="buttonClickHandler(btn, field, $event)" :class="btn.classes" :key="index" v-text="btn.label"></button> |
| 14 | + <button v-for="(btn, index) in field.buttons" @click="buttonClickHandler(btn, field, $event)" :class="btn.classes" :key="index" v-text="btn.label":type="getButtonType(btn)"></button> |
15 | 15 | </div>
|
16 | 16 | </div>
|
17 | 17 |
|
@@ -81,6 +81,10 @@ export default {
|
81 | 81 | getFieldType(fieldSchema) {
|
82 | 82 | return "field-" + fieldSchema.type;
|
83 | 83 | },
|
| 84 | + // Get type of button, default to 'button' |
| 85 | + getButtonType(btn) { |
| 86 | + return objGet(btn, "type", "button"); |
| 87 | + }, |
84 | 88 | // Child field executed validation
|
85 | 89 | onFieldValidated(res, errors, field) {
|
86 | 90 | this.$emit("validated", res, errors, field);
|
|
0 commit comments