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
4ca85202
Commit
4ca85202
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Move backgrounds to example and to slot in grid
parent
e6553ad8
No related branches found
No related tags found
1 merge request
!2
Resolve "Implement basic functionality"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example/src/App.vue
+9
-0
9 additions, 0 deletions
example/src/App.vue
src/DragContainer.vue
+1
-20
1 addition, 20 deletions
src/DragContainer.vue
src/Grid.vue
+14
-2
14 additions, 2 deletions
src/Grid.vue
with
24 additions
and
22 deletions
example/src/App.vue
+
9
−
0
View file @
4ca85202
...
...
@@ -8,6 +8,9 @@ import Grid from "../../src/Grid.vue";
<div
id=
"blocker"
>
This field is blocked because it's filled, the next one programmatically
</div>
<template
#item
="
item
"
>
<div
class=
"container"
>
{{
item
}}
</div>
</
template
>
</Grid>
</div>
</template>
...
...
@@ -67,4 +70,10 @@ export default {
font-weight
:
bold
;
text-shadow
:
4px
4px
4px
#2c3e50
;
}
.container
{
background
:
lightcoral
;
width
:
100%
;
height
:
100%
;
}
</
style
>
This diff is collapsed.
Click to expand it.
src/DragContainer.vue
+
1
−
20
View file @
4ca85202
<
template
>
<div
@
dragstart=
"handleDragStart"
draggable=
"true"
id=
"wrapper"
>
<slot>
<div
id=
"container"
>
<dl>
<dt>
Key
</dt>
<dd>
{{
dragID
}}
</dd>
<dt>
Position
</dt>
<dd>
{{
x
}}
,
{{
y
}}
</dd>
<dt>
Size
</dt>
<dd>
{{
w
}}
×
{{
h
}}
</dd>
<dt>
Data
</dt>
<dd>
{{
data
}}
</dd>
</dl>
</div>
</slot>
<slot></slot>
</div>
</
template
>
...
...
@@ -51,10 +38,4 @@ export default {
grid-column
:
v-bind
(
x
)
/
span
v-bind
(
w
);
grid-row
:
v-bind
(
y
)
/
span
v-bind
(
h
);
}
#container
{
background
:
lightcoral
;
width
:
100%
;
height
:
100%
;
}
</
style
>
This diff is collapsed.
Click to expand it.
src/Grid.vue
+
14
−
2
View file @
4ca85202
...
...
@@ -5,7 +5,7 @@
class=
"grid"
>
<slot
name=
"highlight"
>
<div
id
=
"highlight"
ref=
"highlight"
></div>
<div
class
=
"highlight"
ref=
"highlight"
></div>
</slot>
<DragContainer
v-for=
"item in value"
...
...
@@ -17,6 +17,18 @@
:h=
"item.h"
:data=
"item.data"
>
<slot
v-bind=
"item"
name=
"item"
>
<dl>
<dt>
Key
</dt>
<dd>
{{
item
.
key
}}
</dd>
<dt>
Position
</dt>
<dd>
{{
item
.
x
}}
,
{{
item
.
y
}}
</dd>
<dt>
Size
</dt>
<dd>
{{
item
.
w
}}
×
{{
item
.
h
}}
</dd>
<dt>
Data
</dt>
<dd>
{{
item
.
data
}}
</dd>
</dl>
</slot>
</DragContainer>
<slot></slot>
</div>
...
...
@@ -136,7 +148,7 @@ export default {
</
script
>
<
style
scoped
>
#
highlight
{
.
highlight
{
background
:
darkgrey
;
border
:
grey
dashed
2px
;
display
:
none
;
...
...
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