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-biu-waterfall

v1.0.6

Published

a waterfall layout based on vue3 and ts

Downloads

3

Readme

A waterfall layout based on vue3 and typescript(still in developing now)

Version License

...and, this repository is inspired by following two repositories myst729/Waterfall, MopTym/vue-waterfall

~~ps:you know what? I want to call this biuterfall(biu-waterfall->biuterfall,and similar to beautiful)~~

Demo

biu~ <---click here to see it

gif

Installation

npm install --save vue-biu-waterfall

Import

vue3 + setup + ts

import { WaterfallConfig, WaterfallCell } from 'vue-biu-waterfall/lib'

// these two are for ... 

let items = ...

const reflow= ...
const reflowed = ...

template structure

    <WaterfallConfig  @scrollToBottom="reflow" @allThingDone="reflowed">
      <WaterfallCell :waterCell="item" v-for="item in items" :key="item.index">
        <div>
           <!-- {{ item.lalala }}  -->
           <!-- and you can put more things in this div, such as <img src="item.url">...... -->
        </div>
      </WaterfallCell>
    </WaterfallConfig>

Props

waterfallConfig

Name | Default | Description ---- | ---- | ---- line-gap | ---- | Required. The standard space (px) between lines. min-line-gap | ---- | The minimal space between lines. max-line-gap | --- | The maximal space between lines. single-max-width | --- |The maximal width of slot which is single in horizontal direction. watch | ---- | Watch something, reflow when it changes. interval | ---- | The minimal time interval (ms) between reflow actions.

these props are for computing a layout,I have given a suitable default config, but you can check this function to know how it works exactly, and try out your own config.

waterfallCell

Name | Default | Description ---- | ---- | ---- item | ---- | item item.index | ---- | Required item.width | ---- | Required item.height | ---- | Required item.style | ---- | ---- item.url | ---- | ---- item.content | ---- | ---- '[keyName: string]: any '| ---- | ----

Here we directly pass the object into waterfallCell, but the object should have flowing features: index, height, width. These three are needed to computed the rect to display and can't be empty, the style, url, content could be empty, I give it here to make it convenient to store and use the features you may want in template, and if you don't like these names... '[keyName: string]: any', define it yourself is also ok.

Transition

Events

@scrollToBottom

This is a event for lazy-load, you can call a function to add items when this event was triggered.

@allThingDone

This is a event for preventing the excessive requests(such as too much scroll) smash the machine, you can use it with a lock variable to protect the program. And you can use many other way help to implement debouncing and throttling.

Reactivity

License

Released under the MIT License.