# vue-tiles

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

Latest version **0.0.2** (published 2017-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-tiles
pnpm add vue-tiles
yarn add vue-tiles
bun add vue-tiles
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-08-17 |
| First published | 2017-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Collier Devlin |
| Maintainers | jocodev |

## Links

- npm: https://www.npmjs.com/package/vue-tiles
- npm.io page: https://npm.io/package/vue-tiles

## Dependencies (4)

- [muuri](https://npm.io/package/muuri.md) ^0.4.0
- [jquery](https://npm.io/package/jquery.md) ^3.2.1
- [hammerjs](https://npm.io/package/hammerjs.md) ^2.0.8
- [velocityjs](https://npm.io/package/velocityjs.md) ^0.9.6

## Recent versions

- 0.0.2 (latest) — 2017-08-17
- 0.0.1 — 2017-08-17

## README

# vue-tiles

[![npm](https://img.shields.io/npm/v/vue-tiles.svg)](https://www.npmjs.com/package/vue-tiles) [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)

> A vue plugin using [Muuri](https://github.com/haltu/muuri)'s responsive, sortable, filterable and draggable grid layouts.

Vue-tiles was created to provide an alternative option for creating a responsive dashboard in Vue. It is essentially a vue wrapper for [Muuri](https://github.com/haltu/muuri). Using Vue's modular component system, vue-tiles allows us to drop in any number of tile components to quickly create our dashboard.

## Installation

```bash
npm install --save vue-tiles
```

### Bundler (Webpack)

```js
import Vue from 'vue'
import VueTiles from 'vue-tiles'
// You need a specific loader for CSS files like https://github.com/webpack/css-loader
import 'vue-tiles/dist/vue-tiles.css'

Vue.use(VueTiles)
```

## How to Use

Vue tiles consists of a base `vue-tile-grid` component that implements the [Muuri](https://github.com/haltu/muuri) plugin. Using this component, we will be able to insert any number of tile components through its slot.

Example:
```html
    <vue-tile-grid id="example-grid">
      <!-- slot content -->
    </vue-tile-grid>
```

Out-of-the-box, vue-tiles comes with a few tile components to get you started.
```js
    import { LinkTile, ContentSm, ContentMd, ContentLg } from 'vue-tiles'
```

```html
    <vue-tile-grid id="example-grid">
      <link-tile id="link" text="Example Link" route="/"></link-tile>
      
      <content-sm id="content-sm">
        <p>Here is some small content.</p>
      </content-sm>
      
      <content-md id="content-md">
        <p>Here is some medium content.</p>
      </content-md>
      
      <content-lg id="content-lg">
        <p>Here is large content.</p>
      </content-lg>
    </vue-tile-grid>
```

## Events

Vue-tiles also allows you to listen to events on the grid object created by [Muuri](https://github.com/haltu/muuri). Please refer to the [docs](https://github.com/haltu/muuri) for a complete list of events.

Example:
```html
    <vue-tile-grid id="example-grid" @layoutEnd="updateOrder">
      <content-sm :id="'content-sm-' + index" v-for="num, index in [1,2,3,4]">
        <p>Content {{ num }}</p>
      </content-sm>
    </vue-tile-grid>
```

```js
    // ...
    methods: {
        updateOrder (items) {
            console.log(items)
        }
    }
```

## License

[MIT](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/vue-tiles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
