最近根据需要,做了一个基于layui的无限级联选择器,样式仿照elementUI
1. html元素
<div class="layui-form-item">
<label class="layui-form-label">选择框</label>
<div class="layui-input-block">
<input type="text" id="a" class="layui-input" readonly="readonly">
</div>
</div>
2. js引用
layui.use(['form',"jquery","cascader"], function(){
var $ = layui.jquery;
var cascader = layui.cascader;
var data = [
{
value: 'A',
label: 'a',
children: [
{