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 {
console
.
log
(
event
)
const
file
=
event
.
target
.
files
[
0
]
this
.
url
=
URL
.
createObjectURL
(
file
)
this
.
image
=
file
;
this
.
image
=
file
console
.
log
(
file
)
console
.
log
(
this
.
image
)
},
...
...
@@ -364,7 +364,7 @@ export default {
this
.
$axios
.
delete
(
`/categories/
${
ID
}
`
)
.
then
(
response
=>
{
this
.
categories
.
splice
(
this
.
editedIndex
,
1
)
;
this
.
categories
.
splice
(
this
.
editedIndex
,
1
)
self
.
$toast
.
success
(
'
Category deleted successfully!
'
,{
duration
:
3000
})
...
...
pages/users/index.vue
View file @
72ded375
...
...
@@ -183,7 +183,7 @@
</v-toolbar>
</template>
<
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>
</
template
>
<
template
v-slot:no-data
>
...
...
@@ -250,7 +250,7 @@ export default {
},
computed
:
{
formTitle
()
{
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
;
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
},
},
watch
:
{
...
...
@@ -289,14 +289,14 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedIndex
=
-
1
})
;
})
},
closeDelete
()
{
this
.
dialogDelete
=
false
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedIndex
=
-
1
})
;
})
},
save
()
{
if
(
this
.
editedIndex
>
-
1
)
{
...
...
@@ -304,15 +304,15 @@ export default {
}
else
{
this
.
users
.
push
(
this
.
editedItem
)
}
this
.
close
()
;
this
.
close
()
},
getUsers
()
{
this
.
$axios
.
get
(
'
/users/
'
)
.
then
((
response
)
=>
(
this
.
users
=
response
.
data
.
data
.
data
))
.
catch
(
function
(
error
)
{
console
.
log
(
error
)
;
})
;
console
.
log
(
error
)
})
},
createUser
()
{
const
self
=
this
...
...
@@ -330,7 +330,7 @@ export default {
this
.
$bvModal
.
hide
(
'
modal-login
'
)
self
.
$toast
.
success
(
'
User created successfully!
'
,{
duration
:
3000
})
;
})
console
.
log
(
response
)
this
.
editedItem
=
response
.
data
.
data
console
.
log
(
this
.
editedItem
)
...
...
@@ -343,8 +343,8 @@ export default {
this
.
message
=
errors
.
response
.
data
.
message
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
duration
:
3000
})
;
})
;
})
})
},
deleteUser
(
userID
,
index
)
{
const
self
=
this
...
...
@@ -387,7 +387,7 @@ export default {
.then(response => {
self.$toast.success('User updated successfully!',{
duration: 3000
})
;
})
console.log(response)
this.editedItem = response.data.data
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