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
1d3d31ca
Commit
1d3d31ca
authored
Jan 18, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix breadcrumb
parent
b9dc5cbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
47 deletions
+12
-47
posts.vue
pages/home/posts.vue
+12
-47
No files found.
pages/home/posts.vue
View file @
1d3d31ca
...
@@ -246,13 +246,6 @@ export default {
...
@@ -246,13 +246,6 @@ export default {
sUserId
:
''
,
sUserId
:
''
,
sStatus
:
null
,
sStatus
:
null
,
sImages
:
null
,
sImages
:
null
,
sVariants
:
[
{
color
:
""
,
size
:
""
,
quantity
:
""
,
},
],
eId
:
''
,
eId
:
''
,
eTitle
:
''
,
eTitle
:
''
,
eCategoryId
:
''
,
eCategoryId
:
''
,
...
@@ -311,15 +304,7 @@ export default {
...
@@ -311,15 +304,7 @@ export default {
this
.
sContent
=
''
,
this
.
sContent
=
''
,
this
.
sUserId
=
''
,
this
.
sUserId
=
''
,
this
.
sStatus
=
''
,
this
.
sStatus
=
''
,
this
.
sImages
=
null
,
this
.
sImages
=
null
this
.
sVariants
=
[
{
color
:
""
,
size
:
""
,
quantity
:
""
,
},
];
},
},
editItem
(
item
)
{
editItem
(
item
)
{
this
.
editedIndex
=
this
.
posts
.
indexOf
(
item
)
this
.
editedIndex
=
this
.
posts
.
indexOf
(
item
)
...
@@ -327,12 +312,12 @@ export default {
...
@@ -327,12 +312,12 @@ export default {
this
.
dialog
=
true
this
.
dialog
=
true
},
},
deleteItem
(
item
)
{
deleteItem
(
item
)
{
this
.
editedIndex
=
this
.
posts
.
indexOf
(
item
)
;
this
.
editedIndex
=
this
.
posts
.
indexOf
(
item
)
this
.
editedItem
=
Object
.
assign
({},
item
)
;
this
.
editedItem
=
Object
.
assign
({},
item
)
this
.
dialogDelete
=
true
;
this
.
dialogDelete
=
true
;
},
},
deleteItemConfirm
()
{
deleteItemConfirm
()
{
this
.
posts
.
splice
(
this
.
editedIndex
,
1
)
;
this
.
posts
.
splice
(
this
.
editedIndex
,
1
)
this
.
closeDelete
()
this
.
closeDelete
()
},
},
close
()
{
close
()
{
...
@@ -345,15 +330,15 @@ export default {
...
@@ -345,15 +330,15 @@ export default {
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
)
{
Object
.
assign
(
this
.
posts
[
this
.
editedIndex
],
this
.
editedItem
)
;
Object
.
assign
(
this
.
posts
[
this
.
editedIndex
],
this
.
editedItem
)
}
else
{
}
else
{
this
.
posts
.
push
(
this
.
editedItem
)
;
this
.
posts
.
push
(
this
.
editedItem
)
}
}
this
.
close
()
this
.
close
()
},
},
...
@@ -391,14 +376,14 @@ export default {
...
@@ -391,14 +376,14 @@ export default {
})
})
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
$bvModal
.
hide
(
'
modal-create
'
)
this
.
$bvModal
.
hide
(
'
modal-create
'
)
self
.
$toast
.
success
(
'
P
roduc
t created successfully!
'
,
{
self
.
$toast
.
success
(
'
P
os
t created successfully!
'
,
{
duration
:
3000
duration
:
3000
})
})
})
})
.
catch
(
errors
=>
{
.
catch
(
errors
=>
{
this
.
$bvModal
.
hide
(
'
modal-create
'
)
this
.
$bvModal
.
hide
(
'
modal-create
'
)
console
.
log
(
errors
.
response
.
data
.
message
)
console
.
log
(
errors
.
response
.
data
.
message
)
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
})
})
...
@@ -406,7 +391,7 @@ export default {
...
@@ -406,7 +391,7 @@ export default {
},
},
deletePost
(
ID
,
index
)
{
deletePost
(
ID
,
index
)
{
const
self
=
this
;
const
self
=
this
;
this
.
editedIndex
=
this
.
posts
.
indexOf
(
index
)
;
this
.
editedIndex
=
this
.
posts
.
indexOf
(
index
)
if
(
confirm
(
"
Do you really want to delete?
"
)){
if
(
confirm
(
"
Do you really want to delete?
"
)){
axios
axios
.
delete
(
`http://127.0.0.1:8000/api/posts/
${
ID
}
`
)
.
delete
(
`http://127.0.0.1:8000/api/posts/
${
ID
}
`
)
...
@@ -457,7 +442,7 @@ export default {
...
@@ -457,7 +442,7 @@ export default {
this
.
eUserId
=
item
.
user_id
this
.
eUserId
=
item
.
user_id
// this.eImages = item.images
// this.eImages = item.images
},
},
updatePost
(
ID
)
{
updatePost
()
{
const
self
=
this
;
const
self
=
this
;
axios
axios
.
post
(
`http://127.0.0.1:8000/api/posts/update/
${
this
?.
eId
}
`,{
.
post
(
`http://127.0.0.1:8000/api/posts/update/
${
this
?.
eId
}
`,{
...
@@ -475,7 +460,7 @@ export default {
...
@@ -475,7 +460,7 @@ export default {
})
})
.then(response => {
.then(response => {
this.$bvModal.hide('modal-edit')
this.$bvModal.hide('modal-edit')
self.$toast.success('
User
updated successfully!',{
self.$toast.success('
Post
updated successfully!',{
duration: 3000
duration: 3000
});
});
console.log(response)
console.log(response)
...
@@ -488,26 +473,6 @@ export default {
...
@@ -488,26 +473,6 @@ export default {
})
})
})
})
},
},
addMore() {
this.variants.push({
color: "",
size: "",
quantity: "",
});
},
addMoreVariant() {
this.eVariants.push({
color: "",
size: "",
quantity: "",
});
},
remove(index) {
this.variants.splice(index, 1)
},
removeVariant(index) {
this.eVariants.splice(index, 1)
},
},
},
};
};
</
script
>
</
script
>
...
...
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