Methods
start() → {void}
开始倒计时。如果已在倒计时中,则不执行任何操作。
- Source:
Returns:
- Type
- void
startDragging(e) → {void}
启动拖拽操作的公共函数。
需要将此函数绑定到拖拽手柄(例如一个 resize bar)的 `mousedown` 事件上。
它会记录拖拽的起始状态,并添加全局的鼠标事件监听器。
Parameters:
Name | Type | Description |
---|---|---|
e |
MouseEvent | 鼠标事件对象,通常来自 `mousedown` 事件。 |
- Source:
Returns:
- Type
- void
useCountdown(durationopt) → {Object}
一个 Vue 组合式函数 (Composable),提供一个倒计时功能。
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
duration |
number |
<optional> |
60 | 倒计时的初始秒数。 |
Properties:
Name | Type | Description |
---|---|---|
timeLeft |
Ref.<number> | 响应式的剩余秒数。 |
isCounting |
Ref.<boolean> | 响应式的是否正在倒计时的布尔值。 |
start |
function | 启动倒计时的函数。 |
- Source:
Returns:
包含 timeLeft, isCounting, start 方法的对象。
- Type
- Object
useDraggableWidth(targetElementRef, optionsopt) → {Object}
一个 Vue 组合式函数 (Composable),用于实现元素的水平拖拽改变宽度功能。
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
targetElementRef |
Ref.<(HTMLElement|VueComponent)> | 目标元素的 Vue 引用 (ref),该引用应指向要拖拽改变宽度的 DOM 元素或 Vue 组件实例。 | |||||||||||||||||
options |
object |
<optional> |
{} | 配置选项,用于自定义拖拽行为。
Properties
|
Properties:
Name | Type | Description |
---|---|---|
startDragging |
function | 启动拖拽操作的函数。通常绑定到拖拽手柄的 `mousedown` 事件。 |
- Source:
Returns:
包含 `startDragging` 方法的对象,需要将此方法绑定到拖拽手柄的 `mousedown` 事件上。
- Type
- Object