1.3.0 • Published 2 years ago

vue-balance-text v1.3.0

Weekly downloads
509
License
MIT
Repository
github
Last release
2 years ago

vue-balance-text

A Vue directive that implements balance-text. Here is their demo page.

Install

yarn add vue-balance-text or npm install --save vue-balance-text

Vue

Vue = require('vue')
Vue.directive('balance-text', require('vue-balance-text'))

Nuxt

In nuxt.config.js:

{
  modules: [ 'vue-balance-text/nuxt/module' ]
}

Usage

Use in a Vue template like:

<h1 v-balance-text>A long title with many words that will wrap to multiple lines</h1>

When rendering HTML with v-html, you need to tell v-balance-text to operate on the children vs on the element it's attached to:

<div v-balance-text.children v-html='body'></div>

Example

Before:

npm.io

After:

npm.io

1.3.0

2 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago