fxcosta / laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library
486 stars 112 forks source link

Render markup separately from scripts #96

Open jpswade opened 3 years ago

jpswade commented 3 years ago

This is a bit more of a feature request, but it would be ideal if you could render the markup separately from the scripts.

So then you can push your scripts out of the main body of the template to avoid conflict with other vue elements.

Before:

@section('body')
<div class="chart">
    {{$chart->render()}}
</div>
@endsection

After:

@section('body')
<div class="chart">
    {{$chart->markup()}}
</div>
@endsection
@push('scripts')
    {{$chart->script()}}
@endpush