Giter Site home page Giter Site logo

janakaedirisinghe / vu-read-more Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 17 KB

๐Ÿ“Œ A Simple & customizable readmore package for your vue applications.

Home Page: https://www.npmjs.com/package/vureadmore

License: MIT License

HTML 7.81% Vue 70.07% JavaScript 22.11%
vue npm-package readless readmore vuecomponent

vu-read-more's Introduction

vu-read-more

This is a component/plugin designed for implementing read more functionality that is both straightforward and customizable and is intended to enhance the user experience. โค๏ธ

Usage

npm i vureadmore
import  VuReadMore  from  'vureadmore'

app.component('VuReadMore', VuReadMore);  //Global Registration

components:  {  
	VuReadMore,  
},  //Local Registration

Features

  • Add text break characters length.
  • Custom read more button text.
  • Custom show less button text.
  • Custom readmore/showless button styles.
  • Custom text styles.
  • Add only read more feature without show less.
  • Add redirect link with new tab or same tab.

API

Param Data Type Default Description
text String none This is used to format the read-more/show-less paragaph text based on the charLength
charLength Number 50 This is used to limit the text to generate read-more/show-less text
readMoreText String read more This is used to change the read more button text
readLessText String show less This is used to change the show less button text
buttonStyle Object { color:'blue', cursor:'pointer', text-decoration:'underline' } This is used to customize the read-more/show-less button styles
textStyle Object none This is used to customize the text styles
readMoreOnly Boolean false Control the show-less function. You can use only read-more option here.
redirect Object { link: '#', newTab: true } You can pass a link to navigate the user when the read more button is clicked. You can control the opening positions using newTab key.

Example

<template>
  <span>
    <vu-read-more 
      :text="str" 
      :charLength="maxCharLength"
      readMoreText="Custom Read More Text" 
      readLessText="Custom Show Less Text" 
      :textStyle="textStyle"
      :buttonStyle="buttonStyles"
      :redirect="redirectObj"
    />
  </span>
</template>

<script>
import  VuReadMore  from  'vureadmore'

export default {
  name: 'App',
  data() {
    return {
      str: 'Lorem  dolor sit amet consectetur, adipisicing elit!',
      buttonStyles: { color: 'red', cursor: 'pointer' },
      redirectObj: { link: 'https://www.google.com', newTab: true },
      textStyle: { color: 'red' },
      maxCharLength: 150
    }
  },
  components: {
	  VuReadMore
  }
}
</script>

ezgif com-video-to-gif

vu-read-more's People

Contributors

janakaedirisinghe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.