瀏覽代碼

d1l类型无DataSource报错处理

haojianlong 4 年之前
父節點
當前提交
1dbe2596ef
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/components/data_admin/zoneInput.vue

+ 7 - 3
src/components/data_admin/zoneInput.vue

@@ -76,10 +76,14 @@ export default {
         }
         else if(cascaderInput.indexOf(item.inputMode) != -1){
           let options;
-          if (item.dataSource instanceof Array) {
-            options = item.dataSource;
+          if (item.dataSource) {
+            if (item.dataSource instanceof Array) {
+              options = item.dataSource;
+            } else {
+              options = JSON.parse(item.dataSource)
+            }
           } else {
-            options = JSON.parse(item.dataSource)
+            options = []
           }
           if (options[0] && options[0].content) {
             item.props = {