Coder Social home page Coder Social logo

yar0d / vue-muuri Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jocodev1/vue-muuri

0.0 0.0 0.0 1001 KB

A vue plugin using Muuri's responsive, sortable, filterable and draggable grid layouts.

License: MIT License

JavaScript 67.63% Vue 32.37%

vue-muuri's Introduction

vue-muuri

npm vue2

A vue plugin using Muuri's responsive, sortable, filterable and draggable grid layouts.

Vue-muuri was created to provide an alternative option for creating a responsive dashboard in Vue. It is essentially a vue wrapper for Muuri. Using Vue's modular component system, vue-muuri allows us to drop in any number of tile components to quickly create our dashboard.

Installation

npm install --save vue-muuri

Bundler (Webpack)

import Vue from 'vue'
import VueMuuri from 'vue-muuri'
// You need a specific loader for CSS files like https://github.com/webpack/css-loader
import 'vue-muuri/dist/vue-muuri.css'

Vue.use(VueMuuri)

How to Use

Vue-muuri consists of a base muuri-grid component that implements the Muuri plugin. Using this component, we will be able to insert any number of item components through its slot.

Example:

    <muuri-grid id="example-grid">
      <!-- slot content -->
    </muuri-grid>

Out-of-the-box, vue-muuri comes with a few item components to get you started.

    import { ItemLink, ItemSm, ItemMd, ItemLg } from 'vue-muuri'
    <muuri-grid id="example-grid">
      <item-link id="link" text="Example Link" route="/"></item-link>
      
      <item-sm id="item-sm">
        <p>Small item.</p>
      </item-sm>
      
      <item-md id="item-md">
        <p>Medium item.</p>
      </item-md>
      
      <item-lg id="item-lg">
        <p>Large item.</p>
      </item-lg>
    </muuri-grid>

Events

Vue-muuri also allows you to listen to events on the grid object created by Muuri. Please refer to the docs for a complete list of events.

Example:

    <muuri-grid id="example-grid" @layoutEnd="updateOrder">
      <item-sm :id="'item-sm-' + index" v-for="num, index in [1,2,3,4]">
        <p>Item {{ num }}</p>
      </item-sm>
    </muuri-grid>
    // ...
    methods: {
        updateOrder (items) {
            console.log(items)
        }
    }

License

MIT

vue-muuri's People

Contributors

jocodev1 avatar rbrnx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.