diff --git a/package.json b/package.json index 162b1f2..cb7478d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "variant-form", - "version": "2.2.1", + "version": "2.2.2", "private": false, "scripts": { "serve": "vue-cli-service serve --open src/main.js", diff --git a/src/components/form-designer/form-widget/field-widget/fieldMixin.js b/src/components/form-designer/form-widget/field-widget/fieldMixin.js index 2008d50..b4731ee 100644 --- a/src/components/form-designer/form-widget/field-widget/fieldMixin.js +++ b/src/components/form-designer/form-widget/field-widget/fieldMixin.js @@ -162,14 +162,12 @@ export default { if ((this.field.type === 'radio') || (this.field.type === 'checkbox') || (this.field.type === 'select') || (this.field.type === 'cascader')) { - if (!!this.globalOptionData && this.globalOptionData.hasOwnProperty(this.field.options.name)) { + const newOptionItems = this.getOptionData() + if (!!newOptionItems && newOptionItems.hasOwnProperty(this.field.options.name)) { if (!!keepSelected) { - //this.reloadOptions(this.globalOptionData[this.field.options.name]) /* 异步更新option-data之后不能获取到最新值, - // 以下改用provide的getOptionData()方法 */ - const newOptionItems = this.getOptionData() this.reloadOptions(newOptionItems[this.field.options.name]) } else { - this.loadOptions( this.globalOptionData[this.field.options.name] ) + this.loadOptions(newOptionItems[this.field.options.name]) } } } diff --git a/src/utils/config.js b/src/utils/config.js index 3569bf5..a0b1c36 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -8,7 +8,7 @@ export const DESIGNER_OPTIONS = { } -export const VARIANT_FORM_VERSION = '2.2.1' +export const VARIANT_FORM_VERSION = '2.2.2' //export const MOCK_CASE_URL = 'https://www.fastmock.site/mock/2de212e0dc4b8e0885fea44ab9f2e1d0/vform/' export const MOCK_CASE_URL = 'https://ks3-cn-beijing.ksyuncs.com/vform-static/vcase/'