Skip to content

Commit

Permalink
[fix]{GenerateForm}: 加入defaultValue的类型判断,避免boolean类型时导致报错
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed May 30, 2019
1 parent 6c5f613 commit 35c3c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/FormDesigner/GenerateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default {
let { defaultValue } = genList[i].options;
// 如果默认值设置为$开头,则表示要读取vuex中的全局变量
// 如设置为 $deptname 则读取 this.$store.getters.deptname
if (defaultValue.includes('$')) {
if (defaultValue instanceof String && defaultValue.includes('$')) {
defaultValue = this.$store.getters[defaultValue.replace('$', '')];
}
this.models[genList[i].model] = defaultValue;
Expand Down

0 comments on commit 35c3c78

Please sign in to comment.