Tardigrada777 / vue-text-middle-ellipsis

A Simple vue-directive for the text middle ellipsis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vue Text Middle Ellipsis

npm version npm downloads

A Simple vue-directive for the text middle ellipsis.

Install

npm install vue-text-middle-ellipsis --save # or yarn add vue-text-middle-ellipsis
import Vue from 'vue';
import textMiddleEllipsis from 'vue-text-middle-ellipsis';

Vue.use(textMiddleEllipsis);

Usage

<p v-text-middle-ellipsis="4">Some long text.</p>

The value passed to the directive - is the count of symbols from the end of string that you are want to preserve from truncate.

Result

'Some...ext.'

Live example

Is it useful for you?

Please star this repo. Perhaps you have an idea how to improve this solution? Feel free to suggest your PR.

Contributing

  • Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found.
  • Fork repository, make changes, add your name and link in the authors session readme.md (create if it's not exist)
  • Send a pull request
  • And finally...thank you :)

About

A Simple vue-directive for the text middle ellipsis.


Languages

Language:JavaScript 82.3%Language:Vue 14.2%Language:HTML 3.5%