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
72ded375
Commit
72ded375
authored
Jan 29, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove
parent
e6ee12b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
index.vue
pages/categories/index.vue
+2
-2
index.vue
pages/users/index.vue
+11
-11
No files found.
pages/categories/index.vue
View file @
72ded375
...
@@ -352,7 +352,7 @@ export default {
...
@@ -352,7 +352,7 @@ export default {
console
.
log
(
event
)
console
.
log
(
event
)
const
file
=
event
.
target
.
files
[
0
]
const
file
=
event
.
target
.
files
[
0
]
this
.
url
=
URL
.
createObjectURL
(
file
)
this
.
url
=
URL
.
createObjectURL
(
file
)
this
.
image
=
file
;
this
.
image
=
file
console
.
log
(
file
)
console
.
log
(
file
)
console
.
log
(
this
.
image
)
console
.
log
(
this
.
image
)
},
},
...
@@ -364,7 +364,7 @@ export default {
...
@@ -364,7 +364,7 @@ export default {
this
.
$axios
this
.
$axios
.
delete
(
`/categories/
${
ID
}
`
)
.
delete
(
`/categories/
${
ID
}
`
)
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
categories
.
splice
(
this
.
editedIndex
,
1
)
;
this
.
categories
.
splice
(
this
.
editedIndex
,
1
)
self
.
$toast
.
success
(
'
Category deleted successfully!
'
,{
self
.
$toast
.
success
(
'
Category deleted successfully!
'
,{
duration
:
3000
duration
:
3000
})
})
...
...
pages/users/index.vue
View file @
72ded375
...
@@ -183,7 +183,7 @@
...
@@ -183,7 +183,7 @@
</v-toolbar>
</v-toolbar>
</template>
</template>
<
template
v-slot:item.actions=
"{ item }"
>
<
template
v-slot:item.actions=
"{ item }"
>
<v-icon
small
class=
"mr-2"
@
click=
" editUser(item)
;
"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
class=
"mr-2"
@
click=
" editUser(item)"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"deleteUser(item.id, item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
<v-icon
small
@
click=
"deleteUser(item.id, item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
</
template
>
</
template
>
<
template
v-slot:no-data
>
<
template
v-slot:no-data
>
...
@@ -250,7 +250,7 @@ export default {
...
@@ -250,7 +250,7 @@ export default {
},
},
computed
:
{
computed
:
{
formTitle
()
{
formTitle
()
{
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
;
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
},
},
},
},
watch
:
{
watch
:
{
...
@@ -289,14 +289,14 @@ export default {
...
@@ -289,14 +289,14 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedIndex
=
-
1
this
.
editedIndex
=
-
1
})
;
})
},
},
closeDelete
()
{
closeDelete
()
{
this
.
dialogDelete
=
false
this
.
dialogDelete
=
false
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedIndex
=
-
1
this
.
editedIndex
=
-
1
})
;
})
},
},
save
()
{
save
()
{
if
(
this
.
editedIndex
>
-
1
)
{
if
(
this
.
editedIndex
>
-
1
)
{
...
@@ -304,15 +304,15 @@ export default {
...
@@ -304,15 +304,15 @@ export default {
}
else
{
}
else
{
this
.
users
.
push
(
this
.
editedItem
)
this
.
users
.
push
(
this
.
editedItem
)
}
}
this
.
close
()
;
this
.
close
()
},
},
getUsers
()
{
getUsers
()
{
this
.
$axios
this
.
$axios
.
get
(
'
/users/
'
)
.
get
(
'
/users/
'
)
.
then
((
response
)
=>
(
this
.
users
=
response
.
data
.
data
.
data
))
.
then
((
response
)
=>
(
this
.
users
=
response
.
data
.
data
.
data
))
.
catch
(
function
(
error
)
{
.
catch
(
function
(
error
)
{
console
.
log
(
error
)
;
console
.
log
(
error
)
})
;
})
},
},
createUser
()
{
createUser
()
{
const
self
=
this
const
self
=
this
...
@@ -330,7 +330,7 @@ export default {
...
@@ -330,7 +330,7 @@ export default {
this
.
$bvModal
.
hide
(
'
modal-login
'
)
this
.
$bvModal
.
hide
(
'
modal-login
'
)
self
.
$toast
.
success
(
'
User created successfully!
'
,{
self
.
$toast
.
success
(
'
User created successfully!
'
,{
duration
:
3000
duration
:
3000
})
;
})
console
.
log
(
response
)
console
.
log
(
response
)
this
.
editedItem
=
response
.
data
.
data
this
.
editedItem
=
response
.
data
.
data
console
.
log
(
this
.
editedItem
)
console
.
log
(
this
.
editedItem
)
...
@@ -343,8 +343,8 @@ export default {
...
@@ -343,8 +343,8 @@ export default {
this
.
message
=
errors
.
response
.
data
.
message
this
.
message
=
errors
.
response
.
data
.
message
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
duration
:
3000
duration
:
3000
})
;
})
})
;
})
},
},
deleteUser
(
userID
,
index
)
{
deleteUser
(
userID
,
index
)
{
const
self
=
this
const
self
=
this
...
@@ -387,7 +387,7 @@ export default {
...
@@ -387,7 +387,7 @@ export default {
.then(response => {
.then(response => {
self.$toast.success('User updated successfully!',{
self.$toast.success('User updated successfully!',{
duration: 3000
duration: 3000
})
;
})
console.log(response)
console.log(response)
this.editedItem = response.data.data
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
this.$bvModal.hide('modal-edit')
...
...
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