Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial responsive version #194

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"watch": "cross-env NODE_ENV=production webpack --watch --progress --hide-modules",
"dist": "webpack --progress --hide-modules --config webpack.build.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config webpack.build.min.js"
},
"repository": {
Expand All @@ -38,7 +39,7 @@
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"vue": "^2.2.6",
"vue": "^2.5.16",
"vue-loader": "^11.1.4",
"vue-template-compiler": "^2.2.6",
"webpack": "^3.5.6",
Expand Down
37 changes: 19 additions & 18 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@
<br/>
Row Height: <input type="number" v-model="rowHeight"/> Col nums: <input type="number" v-model="colNum"/>
<br/>
<grid-layout
:layout="layout"
:col-num="parseInt(colNum)"
<responsive-grid-layout
:layout.sync="layout"
:col-num="12"
:row-height="rowHeight"
:is-draggable="draggable"
:is-resizable="resizable"
:is-mirrored="mirrored"
:vertical-compact="true"
:use-css-transforms="true"
>
<grid-item v-for="item in layout" :key="item.i"
:use-css-transforms="true">
<grid-item slot-scope="{item}"
:x="item.x"
:y="item.y"
:w="item.w"
Expand All @@ -55,43 +53,46 @@
@resized="resized"
@moved="moved"
>
<!--<custom-drag-element :text="item.i"></custom-drag-element>-->
<test-element :text="item.i"></test-element>
<!--<button @click="clicked">CLICK ME!</button>-->
</grid-item>
</grid-layout>
</responsive-grid-layout>
<hr/>
<!--<grid-layout
<grid-layout
:layout="layout2"
:col-num="12"
:col-num="parseInt(colNum)"
:row-height="rowHeight"
:is-draggable="draggable"
:is-resizable="resizable"
:is-mirrored="mirrored"
:vertical-compact="true"
:use-css-transforms="true"
>
<grid-item v-for="item in layout2" :key="item.i"
<grid-item v-for="item in layout" :key="item.i"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:min-w="2"
:min-h="2"
:i="item.i"
:is-draggable="item.draggable"
:is-resizable="item.resizable"
@resize="resize"
@move="move"
@resized="resized"
@moved="moved"
>
<!--<custom-drag-element :text="item.i"></custom-drag-element>-->
<test-element :text="item.i"></test-element>
<!--<button @click="clicked">CLICK ME!</button>-->
</grid-item>
</grid-layout>-->
</grid-layout>
</div>
</div>
</template>

<script>
import GridItem from './GridItem.vue';
import GridLayout from './GridLayout.vue';
//import ResponsiveGridLayout from './ResponsiveGridLayout.vue';
import ResponsiveGridLayout from './ResponsiveGridLayout.vue';
import TestElement from './TestElement.vue';
import CustomDragElement from './CustomDragElement.vue';
//var eventBus = require('./eventBus');
Expand Down Expand Up @@ -122,7 +123,7 @@
export default {
name: 'app',
components: {
//ResponsiveGridLayout,
ResponsiveGridLayout,
GridLayout,
GridItem,
TestElement,
Expand Down
2 changes: 1 addition & 1 deletion src/GridItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
this.eventBus.$on('setResizable', self.setResizableHandler);
this.eventBus.$on('setRowHeight', self.setRowHeightHandler);
this.eventBus.$on('directionchange', self.directionchangeHandler);
this.eventBus.$on('setColNum', self.setColNum)
this.eventBus.$on('setColNum', self.setColNum);

var direction = (document.dir !== undefined) ?
document.dir :
Expand Down