Socket
Socket
Sign inDemoInstall

sarathe-library

Package Overview
Dependencies
21
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sarathe-library

This library will have some basic vue components which are ready to use out of the box


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Vue3 + Pagination

image info

You can use use this pagination with both option and composition api.

Install with yarn

yarn add sarathe-library

Install with npm

npm i sarathe-library

  • Import pagination library and css to your component
<script setup>
import {Pagination} from 'sarathe-library';
import 'sarathe-library/dist/sarathe-lib.css'
</script>
  • Add pagination component to template
 <Pagination :items="myArr" @display="getComputedResult"/>

Pagination component accepts array or array of objects as prop and Pagination component emit and event called display.

Full Example

<template>
  <div>
    <table>
      <tbody>
      <tr v-for="displayArr in displayArray">
        {{displayArr}}
      </tr>
      </tbody>
    </table>
    <Pagination :items="myArr" @display="getComputedResult"/>
  </div>
</template>

<script setup>
import { ref,onMounted } from 'vue'
import {Pagination} from 'sarathe-library';
import 'sarathe-library/dist/sarathe-lib.css'

const myArr = ref([]);

let displayArray = ref([])

function getComputedResult(e) {
  displayArray.value = e
}

onMounted(() => {
  for(let i =1 ; i<= 290; i++){
    myArr.value.push('page- ' + i)
  }
})

</script>

<style scoped>

</style>

Props

PropisRequiredUsagesType
itemsyes:items="your actual array"Array
itemsToDisplayno:items-to-display="10"; defaults to 10Number
pageClassnopage-class="css class"; Pagination css classString
pageStyleno:page-style="yourStyleObject"Object
pageActiveClassnopage-active-class="cssClass"; Currently active page classString
pageActiveStyleno:page-active-style="activePageStyleObject"Object
disableShowingLabelno:disable-showing-label="true"; default to trueBoolean

Event

Event nameisRequiredDescription
displayyesThe display event emits computed array which you can use to display inside your template tag

Credits

  • Siddharth Sarathe

  • Pragati Tanwar

Keywords

FAQs

Last updated on 24 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc