Skip to content

jQuery UI tailwind.config.js API

jQuery UI API —— 交互行为(draggable、droppable、sortable)和 UI 部件(accordion、datepicker、dialog、tabs)。

1 class · 4 methods

Interactions

4 methods

为元素添加拖放和重排序行为的交互插件。

theme: { extend: { ... } }

使选中元素可被鼠标拖动。支持 handle、axis、containment 和 grid 等选项。

Parameters

NameTypeDescription
extendobjectObject that adds/overrides colors, spacing, fonts, etc. without clobbering defaults.

Returns

config

Example

tailwind
module.exports = {
  theme: {
    extend: {
      colors: { brand: '#ff5722' },
      spacing: { '128': '32rem' },
    },
  },
};
content: [...paths]

使元素接受可拖动放置;触发 activate/over/out/drop/deactivate 回调。

Parameters

NameTypeDescription
pathsstring[]Glob patterns, e.g. './src/**/*.{html,js}'.

Returns

config

Example

tailwind
module.exports = {
  content: [
    './src/**/*.{html,js,jsx,ts,tsx,vue}',
    './index.html',
  ],
};
darkMode: 'media' | 'class' | 'selector' | [selector]

使子列表可通过拖动排序。支持 placeholder、connectWith 和 update 回调。

Parameters

NameTypeDescription
darkModestring | string[]Strategy: 'media' (default), 'class', 'selector', or a custom selector array.

Returns

config

Example

tailwind
module.exports = {
  darkMode: 'class',
};
theme.extend.colors: { ... }

在初始化后获取或设置现有交互实例的选项。

Parameters

NameTypeDescription
colorsobjectMap of color name to color value (or nested shades).

Returns

config

Example

tailwind
module.exports = {
  theme: {
    extend: {
      colors: {
        brand: {
          500: '#ff5722',
          700: '#c41c00',
        },
      },
    },
  },
};