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

v1.2.4

Published

Vue.js 2 plugin around Colcade

Downloads

26

Readme

📐 Vue Colcade

Lightweight masonry layout thanks to Vuejs

Travis (.org) David NpmLicense

A small wrapper for integrating Colcade to Vuejs.

Vue.js plugin accessible globally from any component to run multiple colcade grid instances. Let's interact with differents grids throughout differents components. This plugin needs you to use the basic Colcade configuration usage.

Install

  npm install vue-colcade
  yarn add vue-colcade

Import vue-colcade.js in the main project file

  import Vue from 'vue';
  import VueColcade from 'vue-colcade';

  Vue.use(VueColcade);

Usage

In your Vue.js components, to create a new grid, simply use:


  this.$colcade.create({
      name: 'myGridName',  // name of colcade instance -> will be used as a reference for grid instance
      el: myGridElement,  // element that hosts the grid -> as mentioned in Colcade config
      config: {  // native Colcade configuration -> as mentioned in Colcade config
        columns: '.grid-col',
        items: '.grid-item',
      },
    });

That grid is accessible across all components by using the new global vue property: $colcade. So you can create as many grids as you want, referencing them by their name. Every future modifications thanks to vue-colcade must referred the name of the instance in order to affect it. As an exemple, if you create an instance with myGridName as name, you can update it with the following method: this.$colcade.update('myGridName').

Methods

vue-colcade offers following methods:

  • create - this.$colcade.create({}) - Create a new instance of Colcade grid -> see usage above
  • destroy - this.$colcade.destroy('myGridName') - Destroy an instance of Colcade grid
  • update - this.$colcade.update('myGridName') - Update grid items (after changing order, removing items...)
  • append - this.$colcade.myGridName.append(items) - Add items to the end of layout
  • prepend - this.$colcade.myGridName.prepend(items) - Add items to the beginning of layout

As exemple, in order to destroy a grid, just call: this.$colcade.destroy('myGridName').

Then, if you need to update items values inside a colcade grid, you may call the following property in order to force Colcade to refresh itself: this.$colcade.update('myGridName').

And, all native colcade methods are still accessibles :

  this.$colcade.myGridName.append();
  this.$colcade.myGridName.prepend();
  this.$colcade.myGridName.destroy(); // be carefull, that doesn't destroy the myGridName instance but only the Colcade grid

By Alexis Colin, thanks to Colcade by David DeSandro

Licence

MIT License.