2-02 2,926 views
最近在使用laravel-excel导出表格的时候,发现假如字段值为0的情况下,导出的excel中直接显示为空,找到一个方法解决,如下.
在laravel-excel的config配置中修改一个设置
 /*
 |--------------------------------------------------------------------------
 | Enable strict null comparison
 |--------------------------------------------------------------------------
 |
 | When enabling strict null comparison empty cells ('') will
 | be added to the sheet.
 */
 'strict_null_comparison' => false,//这个值改成true再试下导出,就显示正常为0了