0.0.48 • Published 10 months ago

vue-directives-lib v0.0.48

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

中文 | English

📦 安装

npm install vue-directives-lib
or
pnpm add vue-directives-lib
or
yarn add vue-directives-lib

🦄 用法

  • 全局引入
// 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");
  • 局部引入
// 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>

🐳 功能列表

指令名说明参数备注
v-copyCopy text content{copyValue,callback}v-copy="'复制的内容'"
v-tooltipWhen the text overflows, display all content around the element{offset:10}v-tooltip={offset:10}
v-longpresslongpress func{callback:()=>{}}v-longpress
v-hiddento hide the element--v-hidden="true"
v-typedtyped text{value: string, loop: true}v-typed="text"
v-ellipsisellipsis text{rows: 1,content: string}v-ellipsis="1"
0.0.43

1 year ago

0.0.44

11 months ago

0.0.45

11 months ago

0.0.46

10 months ago

0.0.47

10 months ago

0.0.48

10 months ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago