Skip to content
Snippets Groups Projects
Commit 41f31a0c authored by Julian's avatar Julian
Browse files

Rename Grid to DragGrid

parent c34c265a
No related branches found
No related tags found
1 merge request!2Resolve "Implement basic functionality"
...@@ -7,7 +7,7 @@ module.exports = { ...@@ -7,7 +7,7 @@ module.exports = {
title: 'Components', title: 'Components',
collapsable: false, collapsable: false,
children: [ children: [
'/components/grid.md', '/components/DragGrid.md',
] ]
} }
] ]
......
# DragGrid
`DragGrid` is a cool component. Here's how to use it...
<template>
<DragGrid :rows="5" :cols="5" v-model="items"></DragGrid>
</template>
\ No newline at end of file
# component
`Component` is a cool component. Here's how to use it...
<template>
<component />
</template>
\ No newline at end of file
<script setup> <script setup>
import Grid from "../../src/Grid.vue"; import DragGrid from "../../src/DragGrid.vue";
import CircularCard from "./components/CircularCard.vue"; import CircularCard from "./components/CircularCard.vue";
</script> </script>
<template> <template>
<div id="app"> <div id="app">
<Grid :rows="5" :cols="5" :pos-validation="blockField" v-model="items"> <DragGrid :rows="5" :cols="5" :pos-validation="blockField" v-model="items">
<div id="blocker"> <div id="blocker">
This field is blocked because it's filled, the next one programmatically This field is blocked because it's filled, the next one programmatically
</div> </div>
<template #item="item"> <template #item="item">
<div class="container">{{ item }}</div> <div class="container">{{ item }}</div>
</template> </template>
</Grid> </DragGrid>
<Grid :rows="3" :cols="3" v-model="ticTacToe" class="tic-tac-toe"> <DragGrid :rows="3" :cols="3" v-model="ticTacToe" class="tic-tac-toe">
<template #item="item"> <template #item="item">
<CircularCard> {{ item.key.startsWith("a") ? "X" : "O"}}</CircularCard> <CircularCard> {{ item.key.startsWith("a") ? "X" : "O" }}</CircularCard>
</template> </template>
</Grid> </DragGrid>
</div> </div>
</template> </template>
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
{ x: 3, y: 3, w: 1, h: 1, key: "b1", data: {} }, { x: 3, y: 3, w: 1, h: 1, key: "b1", data: {} },
{ x: 1, y: 2, w: 1, h: 1, key: "b2", data: {} }, { x: 1, y: 2, w: 1, h: 1, key: "b2", data: {} },
{ x: 3, y: 1, w: 1, h: 1, key: "b3", data: {} }, { x: 3, y: 1, w: 1, h: 1, key: "b3", data: {} },
] ],
}; };
}, },
}; };
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
import DragContainer from "./DragContainer.vue"; import DragContainer from "./DragContainer.vue";
export default { export default {
name: "Grid", name: "DragGrid",
components: { components: {
DragContainer, DragContainer,
}, },
......
import DragContainer from "./DragContainer.vue"; import DragContainer from "./DragContainer.vue";
import Grid from "./Grid.vue"; import DragGrid from "./DragGrid.vue";
export default { DragContainer, Grid }; export default { DragContainer, DragGrid };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment