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
c34c265a
Commit
c34c265a
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Add more examples
parent
4ca85202
No related branches found
No related tags found
1 merge request
!2
Resolve "Implement basic functionality"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/src/App.vue
+20
-1
20 additions, 1 deletion
example/src/App.vue
example/src/components/CircularCard.vue
+26
-0
26 additions, 0 deletions
example/src/components/CircularCard.vue
with
46 additions
and
1 deletion
example/src/App.vue
+
20
−
1
View file @
c34c265a
<
script
setup
>
import
Grid
from
"
../../src/Grid.vue
"
;
import
CircularCard
from
"
./components/CircularCard.vue
"
;
</
script
>
<
template
>
<div
id=
"app"
>
<Grid
:rows=
"
10
"
:cols=
"5"
:pos-validation=
"blockField"
v-model=
"items"
>
<Grid
:rows=
"
5
"
:cols=
"5"
:pos-validation=
"blockField"
v-model=
"items"
>
<div
id=
"blocker"
>
This field is blocked because it's filled, the next one programmatically
</div>
...
...
@@ -12,6 +13,11 @@ import Grid from "../../src/Grid.vue";
<div
class=
"container"
>
{{
item
}}
</div>
</
template
>
</Grid>
<Grid
:rows=
"3"
:cols=
"3"
v-model=
"ticTacToe"
class=
"tic-tac-toe"
>
<
template
#item=
"item"
>
<CircularCard>
{{
item
.
key
.
startsWith
(
"
a
"
)
?
"
X
"
:
"
O
"
}}
</CircularCard>
</
template
>
</Grid>
</div>
</template>
...
...
@@ -45,6 +51,15 @@ export default {
},
{
x
:
5
,
y
:
3
,
w
:
1
,
h
:
1
,
key
:
"
obj9
"
,
data
:
{}
},
],
ticTacToe
:
[
{
x
:
1
,
y
:
1
,
w
:
1
,
h
:
1
,
key
:
"
a1
"
,
data
:
{}
},
{
x
:
1
,
y
:
3
,
w
:
1
,
h
:
1
,
key
:
"
a2
"
,
data
:
{}
},
{
x
:
2
,
y
:
2
,
w
:
1
,
h
:
1
,
key
:
"
a3
"
,
data
:
{}
},
{
x
:
3
,
y
:
2
,
w
:
1
,
h
:
1
,
key
:
"
a4
"
,
data
:
{}
},
{
x
:
3
,
y
:
3
,
w
:
1
,
h
:
1
,
key
:
"
b1
"
,
data
:
{}
},
{
x
:
1
,
y
:
2
,
w
:
1
,
h
:
1
,
key
:
"
b2
"
,
data
:
{}
},
{
x
:
3
,
y
:
1
,
w
:
1
,
h
:
1
,
key
:
"
b3
"
,
data
:
{}
},
]
};
},
};
...
...
@@ -76,4 +91,8 @@ export default {
width
:
100%
;
height
:
100%
;
}
.tic-tac-toe
{
max-width
:
400px
;
}
</
style
>
This diff is collapsed.
Click to expand it.
example/src/components/CircularCard.vue
0 → 100644
+
26
−
0
View file @
c34c265a
<
template
>
<div>
<span><slot></slot></span>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
CircularCard
"
,
};
</
script
>
<
style
scoped
>
div
{
aspect-ratio
:
1
/
1
;
border-radius
:
100%
;
min-height
:
2em
;
box-shadow
:
2px
2px
1px
0
rgba
(
0
,
0
,
0
,
0.75
);
-webkit-box-shadow
:
2px
2px
1px
0
rgba
(
0
,
0
,
0
,
0.75
);
-moz-box-shadow
:
2px
2px
1px
0
rgba
(
0
,
0
,
0
,
0.75
);
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
large
;
}
</
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