ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 加载列表数据 * HTML标签用法 ~~~ 三级列表 //一级列表 <list1 v8-for="(value,keyword,a) in list1"> 名字:{v8:value.name} //二级列表 <arr v8-for="(val,key) in value.arr"> {v8:key}列表1-{v8:val.name}: //三级列表 <list v8-for="(v,k) in val.list"> 内容1-{v8:v.name} <list> </arr> </list1> ~~~ * 注 ~~~ 1.索引值(keyword)可根据需求选择加不加 2.标签名和列表名必须一致,如以上list1 3.多级列表键名键值可自定义名字 4.a指把默认div标签改为a标签 ~~~ * php后端用法 ~~~ $v8_for = []; //>单级列表数据赋值demo $obj = []; $obj[] = ['field1'=>'value1','field2'=>'value2']; $obj[] = ['field1'=>'value1','field2'=>'value2']; $v8_for['list1'] = $obj; //>两级列表数据赋值demo $obj = []; $obj2 = []; $obj2[] = ['field1'=>'value1','field2'=>'value2']; $obj[] = ['field1'=>'value1','field2'=>'value2','list2'=>$obj2]; $obj[] = ['field1'=>'value1','field2'=>'value2','list2'=>[]]; $v8_for['list1'] = $obj; //>三级列表数据赋值demo $obj = []; $obj3 = []; $obj3[] = ['field1'=>'value1','field2'=>'value2']; $obj2 = []; $obj2[] = ['field1'=>'value1','field2'=>'value2','list3'=>$obj3]; $obj[] = ['field1'=>'value1','field2'=>'value2','list2'=>$obj2]; $obj[] = ['field1'=>'value1','field2'=>'value2','list2'=>[]]; $v8_for['list1'] = $obj; ~~~