<script> var postsArr = {{posts}}; var catsArr = {{p.cats}}; </ script>
. This is to solve the problem of insufficient description ability of the template language. If you encounter this problem, directly change the variable into a js object, so that you can directly use it in js.