Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tw2066 opened this issue Nov 8, 2024 · 0 comments
Open

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

tw2066 opened this issue Nov 8, 2024 · 0 comments

Comments

@tw2066
Copy link

tw2066 commented Nov 8, 2024

$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] 记录会丢失

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant