php-ext-xlswriter icon indicating copy to clipboard operation
php-ext-xlswriter copied to clipboard

当header方法在data方法后调用,第一行数据会丢失

Open tw2066 opened this issue 1 year ago • 1 comments

$config = [
    'path' => '/home/viest' // xlsx文件保存路径
];
$excel  = new \Vtiful\Kernel\Excel($config);

// fileName 会自动创建一个工作表,你可以自定义该工作表名称,工作表名称为可选参数
$filePath = $excel->fileName('tutorial01.xlsx', 'sheet1')
    
    ->data([
        ['Rent', 1000],
        ['Gas',  100],
        ['Food', 300],
        ['Gym',  50],
    ])
    ->header(['Item', 'Cost'])
    ->output();

当header方法在data方法后调用,['Rent', 1000] 记录会丢失

期望: 兼容一下,保证不丢失

tw2066 avatar Nov 08 '24 06:11 tw2066