https://fly.layui.com/extend/selectN,selectM/

selectM.js selectN.js

两个文件引入E:\project\admin_xjzm\public\static\admin\layuiadmin下

use([''selectM', 'selectN''])
// 无限级select
var cateurl = '{{ route('admin.item.category') }}';
$.get(cateurl,'',function(res){
    catIns = selectN({
        //元素容器【必填】
        elem: '#categorys'
        ,search:[false,true]
        //候选数据【必填】
        ,data: res
        ,tips: '请选择分类',
    });
});

# data 格式
[
    'id'        => 1,
    'name'      => '一级',
    'children'  => [
            'id'    => 2,
            'name'  => '二级',
        ]
]

 

相关文章:

  • 2021-09-27
  • 2021-07-15
  • 2021-09-11
  • 2021-09-29
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-10-21
  • 2021-12-27
  • 2021-07-20
相关资源
相似解决方案