原始数据
$data = [ "name" => "name", "positions_arr" => ["a", "b", "c", "d"] ];
字符串变量
模板变量字符串赋值给JavaScript变量
var params_str = '{{$data['name']}}'; console.log(params_str);
数组变量
模板变量数组赋值给JavaScript数组变量
var path = []; @foreach($data['positions_arr'] as $p) path.push({{ $p }})); @endforeach