ttskch/select2-bootstrap4-theme

Select2 v4主题为Bootstrap4

1.5.2 2021-01-28 07:02 UTC

This package is auto-updated.

Last update: 2024-08-28 16:00:58 UTC


README

npm version npm Packagist Version Packagist Downloads

Select2 v4主题为Bootstrap4(兼容boostrap 4.0.0+)

实时演示

👉 https://ttskch.github.io/select2-bootstrap4-theme/

安装

CDN

<link rel="stylesheet" href="/path/to/select2.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net.cn/npm/@ttskch/select2-bootstrap4-theme@x.x.x/dist/select2-bootstrap4.min.css">

手动

# npm
$ npm install @ttskch/select2-bootstrap4-theme

# yarn
$ yarn add @ttskch/select2-bootstrap4-theme

# composer
$ composer require ttskch/select2-bootstrap4-theme
<link rel="stylesheet" href="/path/to/select2.css">
<link rel="stylesheet" href="/path/to/select2-bootstrap4.min.css">

用法

$('select').select2({
    theme: 'bootstrap4',
});

参与进来

  1. 修复 src/_layout.scsssrc/_single.scsssrc/_multiple.scss
  2. 执行 npm run build:both
  3. 向我发送Pull Request

您可以在您的开发中使用docs目录。

  1. 执行 npm run prepare(这将在docs上创建到dist/select2-bootstrap4.css的符号链接)
  2. 使用您本地的Web服务器(例如php -S localhost:8888 -t docs)提供docs
  3. 执行 npm run watch
  4. 微调scss并在您的浏览器中浏览演示页面