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-stick

v1.0.7

Published

基于 vue 的瀑布流组件

Downloads

29

Readme

vue-stick

A waterfall flow component based on vue.js

一款基于 vue.js 的瀑布流组件。

demo: https://bh-lay.github.io/vue-stick/demo/

实例 : http://bh-lay.com/blog

如何引入

您可以下载 dist 目录下的产出文件至您的项目中,用任何您希望使用的方式引入。 产出文件包含 umd 模块、ES 模块两个版本,您可以根据自己的项目自行选择。

也可以通过 npm 安装。

npm install -s vue-stick

引入 vue-stick 之后,您可以选择安装为 Vue 全局模块,也可以局部使用。

var Stick = require('vue-stick')
// 全局注册
Vue.use(Stick)

// 局部注册
new Vue({
	data: {},
	components: {
		Stick: Stick.component
	}
})

如何使用

template

<Stick
	:list="list"
	@onScrollEnd="loadMore"
	>
  <template slot-scope="scope">
		<div class="card">
      <img v-if="scope.data.cover" :src="scope.data.cover"/>
      <h2>{{scope.data.title}}</h2>
      <p>{{scope.data.intro}}</p>
    </div>
  </template>
</Stick>

vue

{
  data: {
    list: [
      {
        "cover": "http://static.bh-lay.com/.../share.jpg",
        "intro": "2018 年对于我来说是非...",
        "title": "剧中人的2018年终总结"
      },
      {
        "cover": "http://static.bh-lay.com/.../cover.jpg",
        "intro": "再次见到合肥,在历经五年的沪漂之后...",
        "title": "再见 · 合肥"
      }
    ]
  },
	methods: {
    loadMore: function () {
      this.list.push({
        "cover": "http://static.bh-lay.com/...yout.png",
        "intro": "今天的分享主要围绕 可视化布局模块的一些...",
        "title": "added by scroll 可视化布局模块开发分享"
      })
    }
  }
}

参数

| 参数 | 类型 | 必填 | 默认值 | 解释 | | ------------------- | ------ | ---- | :-------------: | :-------------------- | | list | Array | 必填 | [] | 瀑布流数据列表 | | columnWidth | Number | - | 280 | 卡片宽度 | | columnSpacing | Number | - | 10 | 卡片间距 | | loadTriggerDistance | Number | - | 1000 | 滚动加载距离边界值 | | animationClass | String | - | 'stick-fade-in' | 卡片插入时的动画class |

说明:

因瀑布流的特殊性,请尽可能保证卡片內布局的稳定性。为响应可能的高度变化,本组件会延迟到第一张图片加载完成后再渲染。

该项目由原生瀑布流组件 stick 演绎而成。