├── .npmignore ├── .babelrc ├── demo ├── .babelrc ├── src │ ├── main.js │ ├── util.js │ ├── Icon.vue │ └── App.vue ├── deploy.js ├── index.html ├── package.json └── webpack.config.js ├── .gitignore ├── src ├── index.js ├── util.js ├── mixins │ └── window_size.js ├── GridItem.vue └── Grid.vue ├── LICENSE ├── package.json ├── webpack.config.js ├── README.md └── dist └── index.js /.npmignore: -------------------------------------------------------------------------------- 1 | demo 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "comments": false 4 | } 5 | -------------------------------------------------------------------------------- /demo/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env"] 4 | ], 5 | "plugins": ["transform-object-rest-spread"] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log 4 | package-lock.json 5 | yarn-error.log 6 | demo/dist 7 | *.map 8 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Grid from './Grid.vue' 2 | 3 | export default { 4 | install (Vue) { 5 | Vue.component('Grid', Grid) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | const distance = (x1, y1, x2, y2) => { 2 | return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)) 3 | } 4 | 5 | export default { distance } 6 | -------------------------------------------------------------------------------- /demo/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import Grid from 'plugin' 4 | 5 | Vue.use(Grid) 6 | 7 | new Vue({ 8 | el: '#app', 9 | render: h => h(App) 10 | }) 11 | -------------------------------------------------------------------------------- /demo/deploy.js: -------------------------------------------------------------------------------- 1 | var ghpages = require('gh-pages'); 2 | var path = require('path'); 3 | 4 | ghpages.publish('dist', function(err) { 5 | console.log('Github Pages deployment done.') 6 | 7 | if (err) { 8 | console.log(err) 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
15 |
16 |