bk-showmore

1.0.6 • Public • Published

ShowMore

Solution of ‘show more‘.

Installation

npm install bk-showmore

CommonJS

const ShowMore = require('bk-showmore')

ESM

import ShowMore from 'bk-showmore'

Usage

<div id="app">
  <!-- this span can deal by showmore solution -->
  <span class="showmore"></span>
</div>
ShowMore({
  wrap: '#app', // specify a scope, its childNode with class=“showmore” would have custom overflow solution
  callback: callback, // callback when click 'showmore' button
  isMultiline: true, // is Mulitiline situation, default by true
  text: 'showmore', // 'showmore' button's text
  color: 'deepskyblue' // 'showmore' button's color
})
// need to use after the real DOM is rendered
// an example in Vue3
onMounted(() => {
  nextTick(() => {
    ShowMore({
      wrap: '#app'
    })
  })
})

Readme

Keywords

Package Sidebar

Install

npm i bk-showmore

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

8.99 kB

Total Files

6

Last publish

Collaborators

  • stan_bk