• select2 使用


    1.gitHub:https://github.com/select2/select2

    2.doc:https://select2.org/

    3.引入文件

      <link rel="stylesheet" type="text/css" href="../../libs/select2-4.0.2/dist/css/select2.min.css">

      <script type="text/javascript" src="../libs/select2-4.0.2/dist/js/select2.full.min.js"></script>

    4.example

      css:(自定义) 

        .series-container .select2-container--default .select2-selection--single .select2-selection__rendered{
          height: 35px;
          line-height: 35px;
        }
        .select2.select2-container.select2-container--default,
        .series-container .select2-container--default .select2-selection--single,
        .series-container .select2-container--default .select2-selection--single .select2-selection__arrow,
        .series-container .shopName_selected{
          height: 35px
        }

      html:

        <select id="performace-categories" class="shopName_selected" data-placeholder="请选择绩效名称" style=" 100%;height:35px;"></select>

      js:

        $("#performace-categories").select2({
          data:[{'id':1,'text':'一个月'},{'id':2,'text':'两个月'},{'id':3,'text':'三个月'}],
          allowClear:true
        })

      效果

      

      其它功能参见API文档

        

  • 相关阅读:
    linux bash shell之declare
    shell中的特殊符号
    工作常用shell集合
    sed实例收集
    vim粘贴代码时缩进混乱
    使用脚本实现killproc的功能
    zabbix 的安装
    Linux SSH 互信
    CeontOS7安装ansible
    xtrabackup 链接不上MySQL的问题
  • 原文地址:https://www.cnblogs.com/adolfvicto/p/7724479.html
Copyright © 2020-2023  润新知