Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vue-draggable-grid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
vue-draggable-grid
Commits
fbe19f8a
Commit
fbe19f8a
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Work on documentation
parent
ead36720
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Resolve "Implement basic functionality"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/.vuepress/config.js
+5
-0
5 additions, 0 deletions
docs/.vuepress/config.js
docs/README.md
+8
-7
8 additions, 7 deletions
docs/README.md
docs/guide/index.md
+80
-0
80 additions, 0 deletions
docs/guide/index.md
with
93 additions
and
7 deletions
docs/.vuepress/config.js
+
5
−
0
View file @
fbe19f8a
...
...
@@ -10,6 +10,11 @@ module.exports = {
'
/components/DragGrid.md
'
,
]
}
],
nav
:
[
{
text
:
'
Home
'
,
link
:
'
/
'
},
{
text
:
'
Guide
'
,
link
:
'
/guide/
'
},
{
text
:
'
Repository
'
,
link
:
'
https://edugit.org/AlekSIS/libs/vue-draggable-grid/
'
}
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/README.md
+
8
−
7
View file @
fbe19f8a
# vue-draggable-grid
Document the library here.
### Installation
$ npm install vue-draggable-grid
\ No newline at end of file
---
home
:
true
heroText
:
vue-draggable-grid
tagline
:
A vueJS library to create grids with draggable data blocks.
actionText
:
Get Started →
actionLink
:
/guide/
footer
:
Copyright © 2023-present Julian Leucker
---
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/guide/index.md
0 → 100644
+
80
−
0
View file @
fbe19f8a
---
sidebar
:
auto
---
# Guide
## Quickstart
Install the package
`vue-draggable-grid`
via your favourite package manager.
Include the library in your project:
```
javascript
import
plugin
from
'
vue-draggable-grid
'
;
Vue
.
use
(
plugin
);
// Now create your app as usual
```
Inside the component where you want to use the grid define your grid and data as follows:
```
vue
<
template
>
<drag-grid
v-model=
"items"
:cols=
"4"
:rows=
"4"
>
<template
#item
="
item
"
>
{{
item
.
data
.
text
}}
</
template
>
</drag-grid>
</template>
<
script
>
export
default
{
name
:
"
YourComponent
"
,
data
()
{
return
{
items
:
[
{
x
:
1
,
y
:
3
,
w
:
2
,
h
:
2
,
key
:
"
item1
"
,
data
:
{
text
:
"
Hello world 1
"
},},
{
x
:
2
,
y
:
2
,
w
:
2
,
h
:
1
,
key
:
"
item2
"
,
data
:
{
text
:
"
Hello world 2
"
},},
{
x
:
3
,
y
:
1
,
w
:
1
,
h
:
1
,
key
:
"
item3
"
,
data
:
{
text
:
"
Hello world 3
"
},},
]
}
},
}
</
script
>
```
## Blocking fields
A field (or cell) can be blocked via the
`disabledFields`
prop. The prop receives an array of objects, containing the
coordinates of the blocked fields.
An example for a disabled fields property:
```
javascript
disabledFields
:
[
{
x
:
1
,
y
:
1
},
{
x
:
2
,
y
:
3
},
]
```
## Prevent items from being dragged
To disable dragging of a specific item, simply set the attribute
`disabled`
of the item to
`true`
.
```
javascript{4,5}
someDisabledItems: [
{ key: "key1", x: 1, y: 3, w: 1, h: 1, data: {} },
{ key: "key2", x: 2, y: 2, w: 1, h: 1, data: {} },
{ key: "key3", x: 3, y: 1, w: 1, h: 1, data: {}, disabled: true },
{ key: "key4", x: 1, y: 2, w: 1, h: 1, data: {}, disabled: true },
]
```
The highlighted items are not draggable.
## Disabling the grid
If the boolean property
`disabled`
is set for the whole grid, the grid itself is disabled,
and items can't be moved.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment