详细:https://github.com/hnzzmsf/layui-formSelects

一、引入select组件的css

<link rel="stylesheet" href="__CSS__/formSelects-v4.css" media="all">

二、Html代码

    <div class="layui-form-item">
      <label class="layui-form-label">可用门店</label>
      <div class="layui-input-inline" style="width: 500px;">
        <select name="merch_config_ids" xm-select="merch_config_ids" lay-verify="required">
          <option value=""></option>
          {foreach $hotel_store_id as $v}
          <option value="{$v.id}" {in name="$v.id" value="$info['merch_config_ids']"} selected  {/in}>{$v.name}</option>
          {/foreach}
        </select>
      </div>
    </div>

三、引入select组件基于jq的js

    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    <script src="__STATIC__/admin/js/formSelects-v4.js" type="text/javascript" charset="utf-8"></script>

  <!--下拉多选 初始化渲染-->
  <script type="text/javascript">
      formSelects.render('merch_config_id');
  </script>

四、最后直接提交即可

直接用 POST、GET 提交即可, 它会自动拼成用 ‘,’ 连接形式

我 秦始皇 打钱