🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
完整案例 ~~~ $list = $this->getQuestionBankList(); $tbuilder = TBuilder('tree',$this)->setRowList($list); return $tbuilder->addTopButton([ //添加顶部按钮 'type' => 'add', 'icon_class'=> 'fa fa-plus-circle', 'href' => url('addQuestionBank'), 'popup' => true, 'attr' => ['modal-wh'=>'400|230'] ]) ->addTopButton([ 'type' => 'custom', 'title' => '保存分组', 'item_class'=> 'save_sort_list_data', 'icon_class'=> 'fa fa-check', 'href' => 'javascript:;', ]) ->addTopButton([ 'type' => 'custom', 'title' => '展开所有节点', 'icon_class'=> 'fa fa-plus', 'href' => 'javascript:;', ]) ->addTopButton([ 'type' => 'custom', 'title' => '收起所有节点', 'icon_class'=> 'fa fa-minus', ]) // 添加显示元素 ->setColumns([ // 批量设置数据列 ['title.text', '名称'], ['', '操作', ['type'=>'btn']] ]) // 添加相关操作按钮 ->addListButton([ 'type' => 'edit', 'href_base' => 'editQuestionBank', 'icon_class'=> 'fa fa-pencil', 'popup' => true, 'attr' => ['modal-wh'=>'400|230'] ]) ->addListButton([ 'type' => 'add', 'href_base' => 'addQuestionBank', 'href_param'=> 'pid.id', 'popup' => true, 'attr' => ['modal-wh'=>'400|230'] ]) ->addListButton([ 'type' => 'del', 'href_base' => 'delQuestionBank', 'icon_class'=> 'fa fa-remove text-danger-light', ]) ->addListButton([ 'title' => '题目管理', 'is_show_title' => 1, 'item_class' => 'btn-alert', 'icon_class' => 'fa fa-th-list', 'href_base' => 'topic/index', 'href_param' => 'qb_id.id', ]) ->fetch(); ~~~ 备注说明 * list按钮文字说明在树形组件中隐藏,需要显示配置is_show_title为1即可