| 1 |
Vue.component('field-name', { |
| 2 |
template: '#tmpl-wpuf-field-name', |
| 3 |
|
| 4 |
mixins: [ |
| 5 |
wpuf_mixins.option_field_mixin |
| 6 |
], |
| 7 |
|
| 8 |
computed: { |
| 9 |
value: { |
| 10 |
get: function () { |
| 11 |
return this.editing_form_field[this.option_field.name]; |
| 12 |
}, |
| 13 |
|
| 14 |
set: function (value) { |
| 15 |
this.update_value(this.option_field.name, value); |
| 16 |
} |
| 17 |
} |
| 18 |
}, |
| 19 |
|
| 20 |
methods: { |
| 21 |
on_focusout: function (e) { |
| 22 |
wpuf_form_builder.event_hub.$emit('field-text-focusout', e, this); |
| 23 |
}, |
| 24 |
on_keyup: function (e) { |
| 25 |
wpuf_form_builder.event_hub.$emit('field-text-keyup', e, this); |
| 26 |
}, |
| 27 |
insertValue: function(type, field, property) { |
| 28 |
var value = ( field !== undefined ) ? '{' + type + ':' + field + '}' : '{' + type + '}'; |
| 29 |
this.editing_form_field[property.name][property.type] = value; |
| 30 |
}, |
| 31 |
} |
| 32 |
}); |
| 33 |
|