修复非箭头函数的this指向问题。
parent
07c9f5f846
commit
665342ebf8
|
@ -90,14 +90,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
initEventHandler() {
|
initEventHandler() {
|
||||||
this.$on('setFormData', function (newFormData) {
|
this.$on('setFormData', (newFormData) => {
|
||||||
//console.log('formModel of globalModel----------', this.globalModel.formModel)
|
//console.log('formModel of globalModel----------', this.globalModel.formModel)
|
||||||
if (!this.subFormItemFlag) {
|
if (!this.subFormItemFlag) {
|
||||||
this.setValue(newFormData[this.field.options.name])
|
this.setValue(newFormData[this.field.options.name])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$on('field-value-changed', function (values) {
|
this.$on('field-value-changed', (values) => {
|
||||||
if (!!this.subFormItemFlag) {
|
if (!!this.subFormItemFlag) {
|
||||||
let subFormData = this.formModel[this.subFormName]
|
let subFormData = this.formModel[this.subFormName]
|
||||||
this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId)
|
this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId)
|
||||||
|
@ -107,7 +107,7 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
/* 监听重新加载选项事件 */
|
/* 监听重新加载选项事件 */
|
||||||
this.$on('reloadOptionItems', function (widgetNames) {
|
this.$on('reloadOptionItems', (widgetNames) => {
|
||||||
if ((widgetNames.length === 0) || (widgetNames.indexOf(this.field.options.name) > -1)) {
|
if ((widgetNames.length === 0) || (widgetNames.indexOf(this.field.options.name) > -1)) {
|
||||||
this.initOptionItems(true)
|
this.initOptionItems(true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$on('setFormData', function (newFormData) {
|
this.$on('setFormData', (newFormData) => {
|
||||||
this.initRowIdData(false)
|
this.initRowIdData(false)
|
||||||
this.initFieldSchemaData()
|
this.initFieldSchemaData()
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ export const generateCode = function(formJson, codeType= 'vue') {
|
||||||
optionData: {}
|
optionData: {}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submitForm: function() {
|
submitForm() {
|
||||||
this.$refs.vFormRef.getFormData().then( function(formData) {
|
this.$refs.vFormRef.getFormData().then( function(formData) {
|
||||||
// Form Validation OK
|
// Form Validation OK
|
||||||
alert( JSON.stringify(formData) )
|
alert( JSON.stringify(formData) )
|
||||||
|
|
Loading…
Reference in New Issue