# zxl-common-utils

> A Vue 3 utility library with common tools, components and helpers

Latest version **0.0.28** (published 2026-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install zxl-common-utils
pnpm add zxl-common-utils
yarn add zxl-common-utils
bun add zxl-common-utils
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.28 |
| Published | 2026-08-19 |
| First published | 2026-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 102.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zxl |
| Maintainers | zhuxianliang |
| Keywords | vue3, typescript, visualization, components, utils |

## Links

- npm: https://www.npmjs.com/package/zxl-common-utils
- npm.io page: https://npm.io/package/zxl-common-utils

## Dependencies (1)

- [@types/lodash-es](https://npm.io/package/@types/lodash-es.md) ^4.17.12

## Recent versions

- 0.0.28 (latest) — 2026-08-19
- 0.0.27 — 2026-08-05
- 0.0.26 — 2026-08-04
- 0.0.25 — 2026-08-02
- 0.0.24 — 2026-08-02
- 0.0.23 — 2026-07-09
- 0.0.22 — 2026-07-09
- 0.0.21 — 2026-07-08
- 0.0.20 — 2026-07-08
- 0.0.19 — 2026-07-08
- 0.0.18 — 2026-07-08
- 0.0.17 — 2026-07-08
- 0.0.16 — 2026-07-08
- 0.0.15 — 2026-07-08
- 0.0.14 — 2026-07-01
- … 13 more at https://npm.io/package/zxl-common-utils/versions

## README

# zxl-common-utils

一个基于 Vue 3 和 TypeScript 的通用工具库，封装常用方法、组件与工具。

## 安装

```bash
npm install zxl-common-utils
```

## 使用组件
### 滚动组件有两种：
#### domAutoScroll  dom滚动

```vue
<script setup lang="ts">
import { ref, computed } from 'vue';
import { domAutoScroll } from 'zxl-common-utils';

const props = defineProps<{
  data: Array<{ id: number; name: string }>;
}>();

const scrollAreaRef = ref<HTMLElement | null>(null);

const bindCloneOverlayEvents = (cloneContainer: HTMLElement, index: number) => {
  const curssEl = cloneContainer.querySelector('.curss');
  cloneContainer.addEventListener('mouseenter', () => {
    curssEl?.classList.add('curss-h');
  });
  cloneContainer.addEventListener('mouseleave', () => {
    curssEl?.classList.remove('curss-h');
  });
};
</script>

<template>
  <domAutoScroll
    :enabled="true"
    :item-count="data.length"
    :scroll-config="{mode: 'step', speed: 0.5, stepInterval: 1000, stepDuration: 500}"
    :on-clone-created="bindCloneOverlayEvents"
  >
    <div v-for="item in props.data" :key="item.id" class="item">
      {{ item.name }}
    </div>
  </domAutoScroll>
</template>
```

#### echartsAutoScroll echarts滚动

```vue
<script setup lang="ts">
import { ref } from 'vue';
import { echartsAutoScroll } from 'zxl-common-utils';
const chartRef = ref<HTMLElement | null>(null);

const bindCloneOverlayEvents = (cloneContainer: HTMLElement) => {
  事件逻辑按照自己的来，
};
const getOptions = () => {
  return {
    grid: ...,
    legend: {show: false},
    tooltip: ..,
    xAxis: ...,
    yAxis: ...,
    series: ...,
  } as echarts.EChartsOption;
};
</script>

<template>
  <echartsAutoScroll
   :chartRef="chartRef"
   :enabled="true"
   :itemCount="5"
   :getOptions="getOptions"
   :scrollConfig="{ speed: 0.5, stepInterval: 1000, stepDuration: 500 }"
   @onCloneCreated="bindCloneOverlayEvents"
  >
    <div ref="chartRef" class="echarts-render"></div>
  </echartsAutoScroll>
</template>
```

---
_Source: https://npm.io/package/zxl-common-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
