fix: fixed "TypeError: Cannot read property 'showLegend' of undefined"

fix #57
This commit is contained in:
daniel.xiao
2019-04-28 17:09:44 +08:00
parent 0db5fe3e68
commit beead193b8
2 changed files with 2 additions and 2 deletions
@@ -159,7 +159,7 @@ export default {
},
methods: {
legendEnable(fieldSchema) {
return fieldSchema.ui.showLegend && fieldSchema.ui.legend;
return fieldSchema.ui && fieldSchema.ui.showLegend && fieldSchema.ui.legend;
}
},
mixins: [layoutObjectMixin]
@@ -109,7 +109,7 @@
},
methods: {
legendEnable(fieldSchema) {
return fieldSchema.ui.showLegend && fieldSchema.ui.legend;
return fieldSchema.ui && fieldSchema.ui.showLegend && fieldSchema.ui.legend;
}
},
mixins: [layoutObjectMixin]