🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@skillnull/drage-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@skillnull/drage-js

拖拽元素到页面任意位置

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source
DrageJs

License MIT

JS元素拖拽

CDN

使用 UMD 格式
<script src="https://www.unpkg.com/@skillnull/drage-js@0.0.8/dist/drage.js"></script>
# or
<script src="https://cdn.jsdelivr.net/npm/@skillnull/drage-js@0.0.8/dist/drage.js"></script>


使用 ES 格式
<script src="https://www.unpkg.com/@skillnull/drage-js@0.0.8/dist/drage.es.js" type="module"></script>
# or
<script src="https://cdn.jsdelivr.net/npm/@skillnull/drage-js@0.0.8/dist/drage.es.js" type="module"></script>

安装

# NPM or YARN

yarn add @skillnull/drage-js

# or with npm

npm install @skillnull/drage-js

调用

// 使用 CDN 引用时,无需 import 
import Drage from '@skillnull/drage-js'

/**
 * 启用拖拽
 * @param ref <HTMLElement> [必需]
 * @param style <Object> [非必需,默认值: {}]
 * @param setStorage <String> session(当前窗口关闭前有效,不共享) | local(持久有效,同源窗口共享)  [非必需,默认值: 'local']
 */
Drage.listen({
  ref: HTMLElement,
  style: {},
  setStorage: 'local'
})

// 删除 storage
Drage.storageHandle('remove')

// 停用拖拽
Drage.removeListen()

Keywords

DrageJs

FAQs

Package last updated on 24 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts