1.1.5 • Published 6 years ago
@sabasayer/layout-row-based v1.1.5
layout-row-based
Row based dynamic layout creater.
Rows can be divided to columns and can contain any number of items.
Items can be moved from column to column and sorted inside columns by drag and drop.
For drag and drop used shopify/draggable.
Project setup
yarn installCompiles and hot-reloads for development
yarn serveExample Usage
<template>
<layout-container
:rows="rows"
@update:rows="updateRows"
:layout-items.sync="items"
@update:layoutItems="updateLayout"
edit-mode
sortable
>
<template #default="{id}">
<div style="padding:40px;background:pink;">id : {{id}} , order :{{getItem(id).order}}</div>
</template>
</layout-container>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { LayoutContainerComponent } from "@sabasayer/layout-row-based";
import { LayoutItem, LayoutRow } from "@sabasayer/layout-row-based/types/lib/layout-row";
@Component({
components: {
"layout-container": LayoutContainerComponent
}
})
export default class App extends Vue {
rows: LayoutRow[] = [
{ row: 1, columns: 2 },
{ row: 2, columns: 3 },
{ row: 3, columns: 1 }
];
items: LayoutItem[] = [
{ row: 1, column: 1, order: 0, id: 1 },
{ row: 1, column: 1, order: 1, id: 2 },
];
get getItem(){
return (id:number) => this.items.find(e=>e.id == id);
}
updateRows(rows: LayoutRow[]) {
}
updateLayout(layout: LayoutItem[]) {
console.log('layout',layout)
}
}
</script>Compiles and minifies for production
yarn buildRun your unit tests
yarn test:unitLints and fixes files
yarn lintCustomize configuration
1.1.5
6 years ago
1.1.4
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago