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
5eb58808
Commit
5eb58808
authored
Feb 03, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add format time
parent
1ae90ea2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
37 deletions
+92
-37
DateDisplay.vue
components/DateDisplay.vue
+15
-0
FooterBar.vue
components/FooterBar.vue
+27
-21
nuxt.config.js
nuxt.config.js
+6
-3
index.vue
pages/categories/index.vue
+25
-13
index.vue
pages/products/index.vue
+2
-0
formatTime.js
plugins/formatTime.js
+17
-0
No files found.
components/DateDisplay.vue
0 → 100644
View file @
5eb58808
<
template
>
<span
v-if=
"date"
>
{{
date
.
getMonth
()
+
1
}}
/
{{
date
.
getDate
()
}}
/
{{
date
.
getFullYear
()
}}
</span>
</
template
>
<
script
>
export
default
{
props
:
[
'
date
'
]
}
</
script
>
<
style
>
</
style
>
components/Footer.vue
→
components/Footer
Bar
.vue
View file @
5eb58808
...
@@ -10,30 +10,44 @@
...
@@ -10,30 +10,44 @@
</v-card-text>
</v-card-text>
<v-card-text
class=
"white--text pt-0"
>
<v-card-text
class=
"white--text pt-0"
>
Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet. Mauris cursus commodo interdum. Praesent ut
Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet.
risus eget metus luctus accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a sit amet dui.
Mauris cursus commodo interdum. Praesent ut risus eget metus luctus
Duis commodo vitae velit et faucibus. Morbi vehicula lacinia malesuada. Nulla placerat augue vel ipsum ultrices,
accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a
cursus iaculis dui sollicitudin. Vestibulum eu ipsum vel diam elementum tempor vel ut orci. Orci varius natoque
sit amet dui. Duis commodo vitae velit et faucibus. Morbi vehicula
penatibus et magnis dis parturient montes, nascetur ridiculus mus.
lacinia malesuada. Nulla placerat augue vel ipsum ultrices, cursus
iaculis dui sollicitudin. Vestibulum eu ipsum vel diam elementum tempor
vel ut orci. Orci varius natoque penatibus et magnis dis parturient
montes, nascetur ridiculus mus.
</v-card-text>
</v-card-text>
<v-divider
></v-divider
>
<v-divider
/
>
<div
class=
"footer-bottom"
>
<div
class=
"footer-bottom"
>
<div
class=
"footer-bottom-left"
>
<div
class=
"footer-bottom-left"
>
<figure
class=
"payment"
>
<figure
class=
"payment"
>
<img
src=
"~/assets/images/payment.png"
alt=
"payment"
width=
"159"
height=
"29"
>
<img
src=
"~/assets/images/payment.png"
alt=
"payment"
width=
"159"
height=
"29"
>
</figure>
</figure>
</div>
</div>
<p
class=
"copyright"
>
Riode eCommerce © 2022. All Rights Reserved
</p>
<p
class=
"copyright"
>
Riode eCommerce © 2022. All Rights Reserved
</p>
<div
class=
"footer-bottom-right"
>
<div
class=
"footer-bottom-right"
>
<div
class=
"social-link"
>
<div
class=
"social-link"
>
<v-btn
v-for=
"icon in icons"
:key=
"icon"
class=
"mx-4 white--text"
icon
>
<v-btn
v-for=
"icon in icons"
:key=
"icon"
class=
"mx-4 white--text"
icon
>
<v-icon
size=
"24px"
>
<v-icon
size=
"24px"
>
{{
icon
}}
{{
icon
}}
</v-icon>
</v-icon>
</v-btn>
</v-btn>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -44,13 +58,8 @@
...
@@ -44,13 +58,8 @@
<
script
>
<
script
>
export
default
{
export
default
{
data
:
()
=>
({
data
:
()
=>
({
icons
:
[
icons
:
[
'
mdi-facebook
'
,
'
mdi-twitter
'
,
'
mdi-linkedin
'
,
'
mdi-instagram
'
]
'
mdi-facebook
'
,
})
'
mdi-twitter
'
,
'
mdi-linkedin
'
,
'
mdi-instagram
'
,
],
}),
}
}
</
script
>
</
script
>
...
@@ -58,7 +67,6 @@ export default {
...
@@ -58,7 +67,6 @@ export default {
.footer-bottom-left
{
.footer-bottom-left
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
}
}
.footer-bottom-right
{
.footer-bottom-right
{
...
@@ -67,12 +75,10 @@ export default {
...
@@ -67,12 +75,10 @@ export default {
}
}
.copyright
{
.copyright
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
margin-left
:
auto
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-right
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
nuxt.config.js
View file @
5eb58808
...
@@ -27,7 +27,10 @@ export default {
...
@@ -27,7 +27,10 @@ export default {
],
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins
:
[
'
~/plugins/axios.js
'
],
plugins
:
[
'
~/plugins/axios.js
'
,
'
~/plugins/formatTime.js
'
],
// Auto import components: https://go.nuxtjs.dev/config-components
// Auto import components: https://go.nuxtjs.dev/config-components
components
:
true
,
components
:
true
,
...
@@ -46,7 +49,7 @@ export default {
...
@@ -46,7 +49,7 @@ export default {
'
@nuxtjs/axios
'
,
'
@nuxtjs/axios
'
,
'
@nuxtjs/auth-next
'
,
'
@nuxtjs/auth-next
'
,
'
@nuxtjs/toast
'
,
'
@nuxtjs/toast
'
,
'
@pinia/nuxt
'
,
'
@pinia/nuxt
'
],
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
// Axios module configuration: https://go.nuxtjs.dev/config-axios
...
@@ -55,7 +58,7 @@ export default {
...
@@ -55,7 +58,7 @@ export default {
baseURL
:
'
http://127.0.0.1:8000/api/
'
,
baseURL
:
'
http://127.0.0.1:8000/api/
'
,
debug
:
false
,
debug
:
false
,
proxyHeaders
:
true
,
proxyHeaders
:
true
,
credentials
:
false
,
credentials
:
false
},
},
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
...
...
pages/categories/index.vue
View file @
5eb58808
...
@@ -133,15 +133,8 @@
...
@@ -133,15 +133,8 @@
/>
/>
</v-col>
</v-col>
<v-col
cols=
"12"
>
<v-col
cols=
"12"
>
<v-file-input
<v-img
v-if=
"typeof eImage === 'string'"
:src=
"eImage"
/>
v-model=
"eImage"
accept=
"image/*"
label=
"Image"
prepend-icon=
"mdi-camera"
readonly
/>
</v-col>
</v-col>
<v-img
v-if=
"typeof eImage === 'string'"
:src=
"eImage"
/>
</v-row>
</v-row>
</v-container>
</v-container>
<small>
*indicates required field
</small>
<small>
*indicates required field
</small>
...
@@ -289,6 +282,12 @@
...
@@ -289,6 +282,12 @@
</v-dialog>
</v-dialog>
</v-toolbar>
</v-toolbar>
</
template
>
</
template
>
<
template
#item.created_at=
"{ item }"
>
<span>
{{
formatDate
(
item
.
created_at
)
}}
</span>
</
template
>
<
template
#item.updated_at=
"{ item }"
>
<span>
{{
formatDate
(
item
.
updated_at
)
}}
</span>
</
template
>
<
template
#item.actions=
"{ item }"
>
<
template
#item.actions=
"{ item }"
>
<v-icon
:id=
"item.id"
small
@
click=
"dialog2 = true; editCategory(item)"
>
<v-icon
:id=
"item.id"
small
@
click=
"dialog2 = true; editCategory(item)"
>
mdi-pencil
mdi-pencil
...
@@ -310,6 +309,7 @@
...
@@ -310,6 +309,7 @@
</v-app>
</v-app>
</template>
</template>
<
script
>
<
script
>
export
default
{
export
default
{
layout
:
'
admin
'
,
layout
:
'
admin
'
,
middleware
:
[
'
web
'
],
middleware
:
[
'
web
'
],
...
@@ -320,6 +320,7 @@ export default {
...
@@ -320,6 +320,7 @@ export default {
ordering
:
''
,
ordering
:
''
,
image
:
null
,
image
:
null
,
error
:
''
,
error
:
''
,
dialog
:
false
,
dialog1
:
false
,
dialog1
:
false
,
dialog2
:
false
,
dialog2
:
false
,
dialog3
:
false
,
dialog3
:
false
,
...
@@ -327,17 +328,17 @@ export default {
...
@@ -327,17 +328,17 @@ export default {
options
:
[],
options
:
[],
headers
:
[
headers
:
[
{
{
text
:
'
Name
'
,
text
:
'
ID
'
,
align
:
'
start
'
,
align
:
'
start
'
,
sortable
:
false
,
value
:
'
id
'
value
:
'
name
'
},
},
{
text
:
'
ID
'
,
value
:
'
id
'
},
{
text
:
'
Name
'
,
value
:
'
name
'
},
{
text
:
'
Odering
'
,
value
:
'
ordering
'
},
{
text
:
'
Odering
'
,
value
:
'
ordering
'
},
// { text: 'parent', value: 'parent_id', sortable: false },
// { text: 'parent', value: 'parent_id', sortable: false },
{
text
:
'
Created
'
,
value
:
'
created_at
'
},
{
text
:
'
Created
'
,
value
:
'
created_at
'
},
{
text
:
'
Updated
'
,
value
:
'
updated_at
'
},
{
text
:
'
Updated
'
,
value
:
'
updated_at
'
},
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
}
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
},
{
text
:
'
index
'
,
value
:
'
index
'
,
sortable
:
false
}
],
],
categories
:
[],
categories
:
[],
eID
:
''
,
eID
:
''
,
...
@@ -562,6 +563,17 @@ export default {
...
@@ -562,6 +563,17 @@ export default {
console.log(error)
console.log(error)
}
}
}
}
// formatDate (date) {
// const d = new Date(date)
// let month = '' + (d.getMonth() + 1)
// let day = '' + d.getDate()
// const year = d.getFullYear()
// if (month.length < 2) { month = '0' + month }
// if (day.length < 2) { day = '0' + day }
// return [year, month, day].join('-')
// }
}
}
}
}
</
script
>
</
script
>
pages/products/index.vue
View file @
5eb58808
...
@@ -328,6 +328,7 @@
...
@@ -328,6 +328,7 @@
multiple
multiple
/>
/>
</v-col>
</v-col>
<!-- <v-img v-if="typeof eImage === 'string'" :src="eImages" /> -->
<v-col
cols=
"12"
>
<v-col
cols=
"12"
>
<v-btn
<v-btn
class=
"mx-2"
class=
"mx-2"
...
@@ -763,6 +764,7 @@ export default {
...
@@ -763,6 +764,7 @@ export default {
color
:
''
,
color
:
''
,
size
:
''
,
size
:
''
,
quantity
:
''
,
quantity
:
''
,
dialog
:
false
,
dialog1
:
false
,
dialog1
:
false
,
dialog2
:
false
,
dialog2
:
false
,
dialog3
:
false
,
dialog3
:
false
,
...
...
plugins/formatTime.js
0 → 100644
View file @
5eb58808
import
Vue
from
'
vue
'
Vue
.
mixin
({
methods
:
{
formatDate
(
date
)
{
const
d
=
new
Date
(
date
)
let
month
=
''
+
(
d
.
getMonth
()
+
1
)
let
day
=
''
+
d
.
getDate
()
const
year
=
d
.
getFullYear
()
if
(
month
.
length
<
2
)
{
month
=
'
0
'
+
month
}
if
(
day
.
length
<
2
)
{
day
=
'
0
'
+
day
}
return
[
year
,
month
,
day
].
join
(
'
-
'
)
}
}
})
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