Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
08b143ed
Commit
08b143ed
authored
Feb 16, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add search to table
parent
7ae0989e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
45 deletions
+119
-45
index.vue
pages/categories/index.vue
+63
-37
index.vue
pages/posts/index.vue
+9
-1
index.vue
pages/products/index.vue
+38
-7
index.vue
pages/users/index.vue
+9
-0
No files found.
pages/categories/index.vue
View file @
08b143ed
...
...
@@ -45,7 +45,13 @@
item-text=
"name"
item-value=
"id"
label=
"Parent"
/>
>
<
template
#item
="{
item
}"
>
<div
:class=
"`category-$
{item.depth}`">
{{
item
.
name
}}
</div>
</
template
>
</v-autocomplete>
<!-- <v-card class="mx-auto" max-width="500" dark>
<v-sheet>
<v-text-field
...
...
@@ -75,32 +81,31 @@
@input="selectCategory"
/>
</v-card-text>
</v-card>
</v-col> -->
<v-col
cols=
"12"
>
<v-file-input
v-model=
"eImage"
accept=
"image/*"
label=
"Image"
prepend-icon=
"mdi-camera"
@
change=
"fileSelected"
/>
</v-col>
<v-col
cols=
"12"
>
<img
v-if=
"file"
:src=
"file"
>
</v-col>
<v-col
cols=
"12"
text-align=
" left"
>
<v-img
v-if=
"typeof eImage === 'string'"
contain
height=
"100px"
width=
"150px"
:src=
"eImage"
/>
</v-col>
</v-card> -->
</v-col>
<v-col
cols=
"12"
>
<v-file-input
v-model=
"eImage"
accept=
"image/*"
label=
"Image"
prepend-icon=
"mdi-camera"
@
change=
"fileSelected"
/>
</v-col>
<v-col
cols=
"12"
>
<img
v-if=
"file"
:src=
"file"
>
</v-col>
<v-col
cols=
"12"
text-align=
" left"
>
<v-img
v-if=
"typeof eImage === 'string'"
contain
height=
"100px"
width=
"150px"
:src=
"eImage"
/>
</v-col>
</v-row>
</v-form>
...
...
@@ -138,11 +143,19 @@
:headers=
"headers"
:items=
"categories"
:item-class=
"indentation"
:search=
"searchTable"
sort-by=
"calories"
class=
"elevation-1"
>
<
template
#top
>
<v-toolbar
flat
>
<v-text-field
v-model=
"searchTable"
append-icon=
"mdi-magnify"
label=
"Search"
single-line
hide-details
/>
<v-spacer
/>
<v-toolbar-title
style=
"float: right"
>
<v-dialog
...
...
@@ -191,7 +204,13 @@
item-value=
"id"
label=
"Parent*"
:rules=
"requiredRules"
/>
>
<
template
#item
="{
item
}"
>
<div
:class=
"`category-$
{item.depth}`">
{{
item
.
name
}}
</div>
</
template
>
</v-autocomplete>
</v-col>
<!-- <v-col cols="12">
<v-card class="mx-auto" max-width="500" dark>
...
...
@@ -384,8 +403,8 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
open
:
[
1
,
2
]
,
search
:
null
,
search
:
''
,
search
Table
:
''
,
file
:
null
,
parent_id
:
''
,
name
:
''
,
...
...
@@ -401,18 +420,16 @@ export default {
{
text
:
'
#
'
,
align
:
'
start
'
,
value
:
'
index
'
,
groupable
:
false
value
:
'
index
'
},
{
text
:
'
Name
'
,
value
:
'
name
'
,
groupable
:
false
},
{
text
:
'
Ordering
'
,
value
:
'
ordering
'
,
groupable
:
fals
e
},
{
text
:
'
Created
'
,
value
:
'
created_at
'
,
groupable
:
false
},
{
text
:
'
Updated
'
,
value
:
'
updated_at
'
,
groupable
:
false
},
{
text
:
'
Ordering
'
,
value
:
'
ordering
'
,
filterable
:
tru
e
},
{
text
:
'
Created
'
,
value
:
'
created_at
'
},
{
text
:
'
Updated
'
,
value
:
'
updated_at
'
},
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
,
groupable
:
false
sortable
:
false
}
],
categories
:
[],
...
...
@@ -734,6 +751,15 @@ export default {
.depth-5
>
td
:nth-child
(
2
)
{
padding-left
:
150px
!important
;
}
.category-1
{
padding-left
:
30px
!important
;
}
.category-2
{
padding-left
:
60px
!important
;
}
.category-3
{
padding-left
:
90px
!important
;
}
img
{
width
:
100px
;
height
:
150px
;
...
...
pages/posts/index.vue
View file @
08b143ed
...
...
@@ -213,9 +213,16 @@
</v-dialog>
<!-- table -->
<div>
<v-data-table
:headers=
"headers"
:items=
"posts"
sort-by=
"calories"
class=
"elevation-1"
>
<v-data-table
:headers=
"headers"
:items=
"posts"
:search=
"searchTable"
sort-by=
"calories"
class=
"elevation-1"
>
<
template
#top
>
<v-toolbar
flat
>
<v-text-field
v-model=
"searchTable"
append-icon=
"mdi-magnify"
label=
"Search"
single-line
hide-details
/>
<v-spacer
/>
<v-toolbar-title>
<!-- modal-create -->
...
...
@@ -376,6 +383,7 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
searchTable
:
''
,
file
:
null
,
dialog1
:
false
,
dialog2
:
false
,
...
...
pages/products/index.vue
View file @
08b143ed
...
...
@@ -139,14 +139,21 @@
<v-col
cols=
"12"
>
<v-
select
<v-
autocomplete
v-model=
"eCategoryId"
class=
"select--menu my-select"
:items=
"categories"
item-text=
"name"
item-value=
"id"
label=
"Category"
:rules=
"requiredRules"
/>
>
<
template
#item
="{
item
}"
>
<div
:class=
"`category-$
{item.depth}`">
{{
item
.
name
}}
</div>
</
template
>
</v-autocomplete>
</v-col>
<v-col
cols=
"12"
>
<v-text-field
...
...
@@ -325,11 +332,19 @@
<v-data-table
:headers=
"headers"
:items=
"products"
:search=
"searchTable"
sort-by=
"calories"
class=
"elevation-1"
>
<
template
#top
>
<v-toolbar
flat
>
<v-text-field
v-model=
"searchTable"
append-icon=
"mdi-magnify"
label=
"Search"
single-line
hide-details
/>
<v-spacer
/>
<v-toolbar-title>
<v-dialog
...
...
@@ -369,14 +384,20 @@
<v-col
cols=
"12"
>
<v-
select
<v-
autocomplete
v-model=
"category_id"
:items=
"categories"
item-text=
"name"
item-value=
"id"
label=
"Category"
:rules=
"requiredRules"
/>
>
<
template
#item
="{
item
}"
>
<div
:class=
"`category-$
{item.depth}`">
{{
item
.
name
}}
</div>
</
template
>
</v-autocomplete>
</v-col>
<v-col
cols=
"12"
>
<v-text-field
...
...
@@ -550,6 +571,7 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
searchTable
:
''
,
files
:
[],
name
:
''
,
id
:
''
,
...
...
@@ -1030,8 +1052,17 @@ export default {
}
</
script
>
<
style
>
img
{
width
:
100px
;
height
:
150px
;
.category-1
{
padding-left
:
30px
!important
;
}
.category-2
{
padding-left
:
60px
!important
;
}
.category-3
{
padding-left
:
90px
!important
;
}
img
{
width
:
100px
;
height
:
150px
;
}
</
style
>
pages/users/index.vue
View file @
08b143ed
...
...
@@ -88,11 +88,19 @@
<v-data-table
:headers=
"headers"
:items=
"users"
:search=
"searchTable"
sort-by=
"calories"
class=
"elevation-1"
>
<
template
#top
>
<v-toolbar
flat
>
<v-text-field
v-model=
"searchTable"
append-icon=
"mdi-magnify"
label=
"Search"
single-line
hide-details
/>
<v-spacer
/>
<v-toolbar-title
style=
"float: right"
>
<v-dialog
...
...
@@ -214,6 +222,7 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
searchTable
:
''
,
valid
:
true
,
email
:
''
,
name
:
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment