fluentd-ui/app/javascript/packs/parser_multiline_form.js
Kenji Okimoto b70cc1c0fb
Set formats and format_firstline to plugin_config
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
2018-06-15 11:48:48 +09:00

43 lines
953 B
JavaScript

'use strict'
const ParserMultilineForm = {
template: "#vue-parser-multiline-form",
props: [
"pluginType"
],
data: function() {
return {
formatFirstline: "",
formats: ""
}
},
watch: {
"formatFirstLine": function(newValue, oldValue) {
console.log(`watch formatFirstLine: ${newValue}`)
this.$emit("change-formats", {
"format_firstline": this.formatFirstline,
"formats": this.formats
})
},
"formats": function(newValue, oldValue) {
console.log(`watch formats: ${newValue}`)
this.$emit("change-formats", {
"format_firstline": this.formatFirstline,
"formats": this.formats
})
}
},
methods: {
textareaId: function(pluginType) {
return `setting_${pluginType}_0__formats`
},
textareaName: function(pluginType) {
return `setting[${pluginType}[0]][formats]`
}
}
}
export { ParserMultilineForm as default }