npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-dropload

v1.0.16

Published

mobile drop load,support base js and vue framework.

Downloads

11

Readme

如何使用

更新说明

1. 参数说明

Mdropload(node,_opt);

node:需要进行操作的节点,可以直接传入CSS3选择器,或者document.querySelect选中的节点。

_opt:

|参数|说明| |:---:|:-----| |height|下拉多少PX进行刷新操作| |up|参考 fnopt| |down|参考 fnopt| |fnopt|{fn:下拉触发的方法 回调方法callback,template:包含需要渲染的各种文字模版}|

template结构

{
    none: '下拉刷新',
    message: '释放更新',
    loading: '正在更新,请稍后',
    success: '刷新成功',
    end: '虾面没有了', //此字符为底部加载更多独有
    error: '刷新失败'
}

fn回调函数 callback

  • success 如果刷新成功请回调
  • reset 刷新失败回调此方法用于复位下拉的各种操作
  • end 底部加载更多的时候,如果没有数据了,调用此方法复位,而不是调用success复位.

Mdropload 返回方法

  • destroy 用于销毁整个Mdropload实例

2. 引用

普通版:查看

压缩版:查看

VUE版:查看

<script src='src/Mdropload.js'></script>

3. 使用

Mdropload(document.querySelector('#touchObj'), {
        height: 50
        up: {
            fn: function (cb) {
                console.log('触发了下拉操作');
                setTimeout(function () {
                    cb.success();
                }, 1000);
            },
            template: {
                none: '下拉刷新',
                message: '释放更新',
                loading: '正在更新,请稍后',
                success: '刷新成功',
                error: '刷新失败'
            }
        },
        down: {
            fn: function (cb) {
                console.log('触发了上拉操作');
                cb.success();
                // 重置操作
                // cb.reset();
            },
            template: {
                none: '上拉刷新',
                message: '释放更新',
                loading: '正在更新,请稍后',
                success: '刷新成功',
                error: '刷新失败'
            }
        }
    });

4. vue使用

npm install --save vue-dropload

在项目中引用

import vuedropload from 'vue-dropload';
import vue from 'vue';
vue.use(vuedropload);

使用

import Hello from './components/Hello'
import vue from 'vue'
export default {
  components: {
    Hello
  },
  mounted () {
    console.log('ready ok')
    vue.Mdropload(
      document.querySelector('#app'),
      {
        height: 50,
        up: {
          fn: function (cb) {
            console.log('触发了下拉操作')
            setTimeout(function () {
              cb.success()
            }, 5000)
          },
          template: {
            none: '下拉刷新',
            message: '释放更新',
            loading: '正在更新,请稍后',
            success: '刷新成功',
            error: '刷新失败'
          }
        },
        down: {
          fn: function (cb) {
            console.log('触发了上拉操作')
            cb.success();
          },
          template: {
            none: '上拉刷新',
            message: '释放更新',
            loading: '正在更新,请稍后',
            success: '刷新成功',
            error: '刷新失败'
          }
        }
      }
    )
  }
}

前往DEMO

5. 错误查询

1001:无法寻找到可设置的html节点,请确认后再次调用.

传入的需要设置的节点是null.

6. 如何控制样式?