The v-readmore component is a component for toggle the display according to the height.
in preparation. (v-readmore/examples)
$ npm install --save v-readmore
# or
$ yarn add v-readmore
- Import
VReadmore
and install it in Vue constructor.
import Vue from 'vue'
import VReadmore from 'v-readmore'
Vue.use(VReadmore)
new Vue({
// ...
})
- Use
<v-readmore>
component in your apps.
<template>
<v-readmore>
<li v-for="i in 30" :key="i">item - {{ i }}</li>
</v-readmore>
</template>
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.
-
collapsedHeight
- NumberOptional - You can specify the height to enable readmore
-
(default)
- main content. -
moreLink
- more button element. -
lessLink
- less button element.
MIT