Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.17 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.17 KB

vue-telescope

Vue telescope is a simple text truncation lib for your Vue3 projects

latest version on npm npm downloads a month bundlephobia minified size

How to use

npm i vue-telescope
import { createApp } from "vue";
import App from "./App.vue";
import telescope from 'vue-telescope'
import "./assets/styling/index.css";

const app = createApp(App)

app.use(telescope)
app.mount('#app')
<template>
 <p v-telescope="{ length: 12 }">truncated text</p>
</template>

Or use dynamic values to pass length

<template>
  <button @click="state.textLength++">truncated text length is: {{ state.textLength }}</button>
  <p v-telescope="{ length: state.textLength }">truncated text</p>
</template>

Output

image

Settings

{length: Number}

License

MIT