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
65c17052
Commit
65c17052
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Provide examples of blocked fields
parent
d445fda3
No related branches found
No related tags found
1 merge request
!2
Resolve "Implement basic functionality"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/src/App.vue
+39
-2
39 additions, 2 deletions
example/src/App.vue
with
39 additions
and
2 deletions
example/src/App.vue
+
39
−
2
View file @
65c17052
...
@@ -4,8 +4,45 @@ import Grid from "../../src/Grid.vue";
...
@@ -4,8 +4,45 @@ import Grid from "../../src/Grid.vue";
<
template
>
<
template
>
<div
id=
"app"
>
<div
id=
"app"
>
<Grid
:rows=
"10"
:cols=
"5"
></Grid>
<Grid
:rows=
"10"
:cols=
"5"
:pos-validation=
"blockField"
>
<div
id=
"blocker"
>
This field is blocked because it's filled, the next one programmatically
</div>
</Grid>
</div>
</div>
</
template
>
</
template
>
<
style
scoped
></
style
>
<
script
>
export
default
{
name
:
"
App
"
,
methods
:
{
blockField
(
x
,
y
,
key
)
{
// We won't move fields with ID 'obj8' and nothing into (4, 3)
if
(
x
===
4
&&
y
===
3
)
return
false
;
return
key
!==
"
obj8
"
;
},
},
};
</
script
>
<
style
scoped
>
#blocker
{
grid-row
:
3
/
span
1
;
grid-column
:
3
/
span
1
;
background-image
:
linear-gradient
(
45deg
,
#edd85f
25%
,
#0f2b3d
25%
,
#0f2b3d
50%
,
#edd85f
50%
,
#edd85f
75%
,
#0f2b3d
75%
,
#0f2b3d
100%
);
background-size
:
56.57px
56.57px
;
color
:
white
;
font-size
:
large
;
font-weight
:
bold
;
text-shadow
:
4px
4px
4px
#2c3e50
;
}
</
style
>
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