# vue-directives-lib

> Useful custom commands🎉

Latest version **0.0.48** (published 2024-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-directives-lib
pnpm add vue-directives-lib
yarn add vue-directives-lib
bun add vue-directives-lib
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.48 |
| Published | 2024-08-09 |
| First published | 2023-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 189.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | IceyWu |
| Maintainers | suqiqi |
| Keywords | directives, vue, typescript, vue3, vite, ts |

## Links

- npm: https://www.npmjs.com/package/vue-directives-lib
- Repository: https://github.com/IceyWu/vue-directives-lib
- Homepage: https://github.com/IceyWu/vue-directives-lib/tree/main/#readme
- Issues: https://github.com/IceyWu/vue-directives-lib/issues
- npm.io page: https://npm.io/package/vue-directives-lib

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^3.4.31
- [@vueuse/core](https://npm.io/package/@vueuse/core.md) ^10.11.0
- [@iceywu/utils](https://npm.io/package/@iceywu/utils.md) ^0.0.42
- [@floating-ui/dom](https://npm.io/package/@floating-ui/dom.md) ^1.6.7

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.0.48 (latest) — 2024-08-09
- 0.0.47 — 2024-08-09
- 0.0.46 — 2024-08-09
- 0.0.45 — 2024-07-12
- 0.0.44 — 2024-07-12
- 0.0.43 — 2023-12-22
- 0.0.42 — 2023-12-21
- 0.0.41 — 2023-12-21
- 0.0.4 — 2023-12-12
- 0.0.3 — 2023-12-11
- 0.0.2 — 2023-12-11
- 0.0.1 — 2023-12-09

## README

<h1 align="center">vue-directives-lib</h1>
<p align="center">🚀Useful custom directives for vue </p>

<p align="center">
<a href="https://www.npmjs.com/package/vue-directives-lib" target="__blank"><img src="https://img.shields.io/npm/v/vue-directives-lib?color=a1b858&label=" alt="NPM version"></a>
<a href="https://www.npmjs.com/package/vue-directives-lib" target="__blank"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/vue-directives-lib?color=50a36f&label="></a>
</p>

**Eenglish** | [中文](./README.zh-CN.md)

- [Preview](https://vue-directives-lib.vercel.app/)

## 📦 Installation

```bash
npm install vue-directives-lib
or
pnpm add vue-directives-lib
or
yarn add vue-directives-lib
```

## 🦄 Usage

- Global import

```ts
// main.ts
import { createApp } from "vue";
import App from "./App.vue";
import vueDirectives from "vue-directives-lib";

const app = createApp(App);
app.use(vueDirectives);
app.mount("#app");
```

- Local import

```ts
// test.vue
<template>
  <div
    v-copy="{
      copyValue,
      callback: callbackCopy
    }"
  >
    {{ copyValue }}
  </div>
  <button btn @click="changeVal">
    改变值
  </button>
</template>

<script lang="ts" setup>
import { copy as vCopy } from "vue-directives-lib";
const copyValue = ref("点击我复制内容");
const callbackCopy = arg => {
  console.log('🐳-----arg-----', arg);
};
const changeVal = () => {
  copyValue.value = "改变后的值" + Math.random();
};
</script>
```

## 🐳 Function list

| Directive name | Description                                                     | Parameter                   | Usage                 |
| -------------- | --------------------------------------------------------------- | ----------------------------| --------------------- |
| `v-copy`       | Copy text content                                               | {copyValue,callback}        | v-copy="'复制的内容'"  |
| `v-tooltip`    | When the text overflows, display all content around the element | {offset:10}                 | v-tooltip={offset:10} |
| `v-longpress`  | longpress func                                                  | {callback:()=>{}}           | v-longpress           |
| `v-hidden`     | to hide the element                                             | --                          | v-hidden="true"       |
| `v-typed`      | typed text                                                      | {value: string, loop: true} | v-typed="text"        |
| `v-ellipsis`   | ellipsis text                                                   | {rows: 1,content: string}   | v-ellipsis="1"        |

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