v-readmore

0.0.7 • Public • Published

v-readmore

The v-readmore component is a component for toggle the display according to the height.

Demo

in preparation. (v-readmore/examples)

Installation

$ npm install --save v-readmore
# or 
$ yarn add v-readmore

Usage

  1. Import VReadmore and install it in Vue constructor.
import Vue from 'vue'
import VReadmore from 'v-readmore'
 
Vue.use(VReadmore)
 
new Vue({
  // ...
})
  1. Use <v-readmore> component in your apps.
<template>
  <v-readmore>
    <li v-for="i in 30" :key="i">item - {{ i }}</li>
  </v-readmore>
</template>

Auto installing v-readmore

If you have Vue constructor on window, you don't need to call Vue.use(VReadmore) since it will be called automatically. This is the case when you load Vue.js and v-readmore via <script> element.

References

<v-readmore> component

Props

  • collapsedHeight - Number

    Optional - You can specify the height to enable readmore

Slots

  • (default) - main content.

  • moreLink - more button element.

  • lessLink - less button element.

License

MIT

Package Sidebar

Install

npm i v-readmore

Weekly Downloads

30

Version

0.0.7

License

MIT

Unpacked Size

27.4 kB

Total Files

42

Last publish

Collaborators

  • sinshutu