下拉多選解決方案 1.多選, 單選, 重復(fù)選 2.分組, 遠(yuǎn)程搜索, 本地搜索, 分頁 3.自定義主題, 工具條 4.下拉樹,下拉任意 ... 讓下拉選擇變成一種藝術(shù)^_^
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
</head>
<body>
<div id="demo1" style="width: 300px; margin: 20px;"></div>
<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
//加載組件
layui.config({
base: './layui_exts/xmSelect/'
}).extend({
xmSelect: 'xm-select'
}).use(['xmSelect'], function(){
var xmSelect = layui.xmSelect;
//渲染多選
var demo1 = xmSelect.render({
el: '#demo1',
data: [
{name: '張三', value: 1},
{name: '李四', value: 2},
{name: '王五', value: 3},
]
})
})
</script>
</body>
</html>