1.添加js文件:
2.html文件:
<div id="test">
<div id="checkPer"></div>
</div>
<script src="../../script/xm-select.js"></script>
//赋值
<script>
var demo1 = xmSelect.render({
el: '#checkPer',
data: [
{name: '张三', value: 1},
{name: '李四', value: 2},
{name: '王五', value: 3},
]
})
</script>
\\取值
var checkPer = demo1.getValue('name');
官网参照:
https://maplemei.gitee.io/xm-select/?lalalalalala=1#/senior/form