Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

balm-scroll

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balm-scroll

Smooth scrolling for Vue.js

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Balm Scroll

What is BalmScroll?

iScroll based, smooth scrolling for Vue.js

Demos & Documentation

Quick Start

0. Requirement

  • BalmJS(Recommended) or other toolchains
  • Vue.js@2.1.0+

1. Install

npm i --save balm-scroll
# OR
yarn add balm-scroll

2. Usage

2.1 Css (Edit my-project/app/styles/global/_vendor.scss)
@import 'node_modules/balm-scroll/dist/balm-scroll.scss';
2.2 Js (Edit my-project/app/scripts/main.js)

Default Usage

import Vue from 'vue';
import BalmScroll from 'balm-scroll';

Vue.use(BalmScroll);

Standalone Usage

import Vue from 'vue';
import UiScroll from 'balm-scroll/components/scroll';
// OR
// import UiScrollLite from 'balm-scroll/components/scroll-lite';
// import UiScrollProbe from 'balm-scroll/components/scroll-probe';
// import UiScrollZoom from 'balm-scroll/components/scroll-zoom';
// import UiScrollInfinite from 'balm-scroll/components/scroll-infinite';

Vue.use(UiScroll);
2.3 Vue (Edit a vue component: my-project/app/scripts/views/demos/hello.vue)
<template>
  <ui-scroll :options="options">
    <!-- Content -->
  </ui-scroll>
</template>
export default {
  data() {
    return {
      options: {
        mouseWheel: true
      }
    };
  }
};
2.4 Default css sprites

Download pull-icon@2x.png and extract to /path/to/my-project/app/images.

⚠️: Applicable only for the <ui-scroll-probe>

3. Configuring

3.1 The many faces of iScroll
  • <ui-scroll>
  • <ui-scroll-lite>
  • <ui-scroll-probe>
  • <ui-scroll-zoom>
  • <ui-scroll-infinite>

Tips: You can pick one component that better suits your need

3.2 Options

4. Props, Slots and Events

4.1 Props
Common props
NameTypeDefaultDescription
optionsobject{}iScroll options
excludesarrayExcludes for touchmove event preventDefault
pullDownActionfunction(refresh: Function)nullPull down action
pullUpActionfunction(refresh: Function)nullPull up action
pullOffsetnumber5Down and up offset for triggering pull action
scrollEnabledbooleantrueLoad more data controls
<ui-scroll-probe> extra props
NameTypeDefaultDescription
pullDownLabelstring'Pull down to refresh'Pull down label
pullUpLabelstring'Pull up to load more'Pull up label
releaseLabelstring'Release to update'Release label
loadingLabelstring'Loading...'Loading label
pullDownYnumber5Pull down Y position
pullActionfunction(scroll: object)nullScroll action

⚠️ Special refresh function for first loaded

<ui-scroll ref="iScroll" :pullUpAction="pullUpAction"></ui-scroll>
export default {
  methods: {
    firstLoaded() {
      // Update here your DOM

      this.$refs.iScroll.refresh();
    },
    pullUpAction(refresh) {
      // Update here your DOM

      setTimeout(function() {
        refresh();
      }, 0);
    }
  }
};
4.2 Slots
NameDescription
defaultThe default slot holds the scroll child components
pullDownIcon ⚠️Custom pull down icon
pullDownLabel ⚠️Custom pull down label
pullUpIcon ⚠️Custom pull up icon
pullUpLabel ⚠️Custom pull up label

⚠️: Applicable only for the <ui-scroll-probe>

Special Thanks to

Keywords

FAQs

Package last updated on 19 Feb 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc