Просмотр исходного кода

解决模板内容为空报错问题

zhuth 8 лет назад
Родитель
Сommit
5821d46294

+ 2 - 0
kanban-client/README.md

@@ -58,6 +58,8 @@ columns[i].rowStyle---------------指定列数据列样式
 ##### 20170928
 * table行定义很小时字体会显得很大,调整为最大不超过屏幕适配大小(行数定义过大仍然会使字体变得很小以显示出定义的行数)
 * 修改table列宽算法,按比例调整设置的列宽
+##### 20171012
+* 解决模板内容为空报错问题
 #### 运行
 * 本地运行
 ```

+ 1 - 1
kanban-client/app/component/converter.js

@@ -1,7 +1,7 @@
 function converter(data) {
     let { content } = data;
     let { title, items } = content;
-    let itemsarr = items instanceof Array ? items : [items];
+    let itemsarr = items ? (items instanceof Array ? items : [items]) : [];
 
     let me = this;
     let newItems = itemsarr.map(function (v, i) {

+ 1 - 1
kanban-client/app/component/factory.dev.js

@@ -5,7 +5,7 @@ import MessageBox from '../src/MsgBox/MessageBox.jsx';
 import { converter } from './converter.js';
 import URL from '../constants/url.dev.json';
 
-import tempdata from '../data/config.json';
+import tempdata from '../data/typeError.json';
 
 class Factory extends React.Component {