Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-mugen-scroll
Advanced tools
むげん [mugen] means Infinity in English.
$ npm install --save vue-mugen-scroll
CDN: https://unpkg.com/vue-mugen-scroll/dist/
Demo: JSFiddle
<template>
<div id="app">
<div class="list">your list of items</div>
<!-- add the component right after your list -->
<mugen-scroll :handler="fetchData" :should-handle="!loading">
loading...
</mugen-scroll>
</div>
</template>
<script>
import MugenScroll from 'vue-mugen-scroll'
export default {
data() {
// do not run handler when it's loading
return {loading: false}
},
methods: {
fetchData() {
this.loading = true
// ... the code you wanna run to fetch data
this.loading = false
}
},
components: {MugenScroll}
}
</script>
Type: function
Required: true
The handler function to run after you scroll to the bottom of the list. It will also be invoked on component mounted and the mugen-scroll
component is visible in viewport.
Type: boolean
Default: true
Invoke the handler function on component mounted.
Type: boolean
Default: true
Add an additional condition to check if it should invoke the handler function, for example you don't want it to be invoked again as it's loading.
Type: number
Default: 0
Set the ratio of the <mugen-scroll>
's height and width that needs to be visible for it to be considered in viewport. This defaults to 0, meaning any amount. A threshold of 0.5 or 1 will require that half or all, respectively, of the element's height and width need to be visible. threshold must be a number between 0 and 1
Type: string
If the container of your list is scrollable, you can specific the reference ID of the container, so that we can detect the scroll
event of this element instead of window
.
<template>
<div class="wrap"
<!-- the container is scrollable here -->
style="height: 200px; overflow: auto;"
<!-- add the ref -->
ref="wrap">
<div class="list"><!-- your list --></div>
<mugen-scroll
<!-- pass the ref id -->
scroll-container="wrap">
Loading...
</mugen-scroll>
</div>
</template>
You can run the example with vbuild
git clone https://github.com/egoist/vue-mugen-scroll.git
cd vue-mugen-scroll
yarn
yarn example
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
FAQs
Infinite scroll component for Vue.js
The npm package vue-mugen-scroll receives a total of 2,735 weekly downloads. As such, vue-mugen-scroll popularity was classified as popular.
We found that vue-mugen-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.