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
6aecb92f
Commit
6aecb92f
authored
Jan 16, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create products
parent
05c812e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
products.vue
pages/home/products.vue
+7
-7
No files found.
pages/home/products.vue
View file @
6aecb92f
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<b-breadcrumb-item
href=
"/home/products"
>
Product
</b-breadcrumb-item>
<b-breadcrumb-item
href=
"/home/products"
>
Product
</b-breadcrumb-item>
</b-breadcrumb>
</b-breadcrumb>
<div
style=
"float: right"
>
<div
style=
"float: right"
>
<b-button
v-b-modal
.
modal-create
>
New Product
</b-button></div>
<b-button
class=
"text-white"
v-b-modal
.
modal-create
>
New Product
</b-button></div>
<b-modal
id=
"modal-create"
title=
"create Product"
class=
"modal fade"
>
<b-modal
id=
"modal-create"
title=
"create Product"
class=
"modal fade"
>
<div
class=
"w-full mt-4 p-10"
>
<div
class=
"w-full mt-4 p-10"
>
<form
>
<form
>
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
</div>
</div>
<template
#modal-footer
>
<template
#modal-footer
>
<button
v-b-modal
.
modal-close_visit
@
click=
"$bvModal.hide('modal-create')"
class=
"btn btn-danger btn-sm m-1"
>
Close
</button>
<button
v-b-modal
.
modal-close_visit
@
click=
"$bvModal.hide('modal-create')"
class=
"btn btn-danger btn-sm m-1"
>
Close
</button>
<button
@
click=
"getInfo();"
v-b-modal
.
modal-close_visit
class=
"btn btn-success btn-sm m-1"
>
Submit
</button>
<button
@
click=
"getInfo();
createProduct();
"
v-b-modal
.
modal-close_visit
class=
"btn btn-success btn-sm m-1"
>
Submit
</button>
</
template
>
</
template
>
</b-modal>
</b-modal>
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
>
>
<
template
v-slot:top
>
<
template
v-slot:top
>
<v-toolbar
flat
>
<v-toolbar
flat
>
<v-toolbar-title>
Category
Manage
</v-toolbar-title>
<v-toolbar-title>
Product
Manage
</v-toolbar-title>
<v-divider
class=
"mx-4"
inset
vertical
></v-divider>
<v-divider
class=
"mx-4"
inset
vertical
></v-divider>
<v-spacer></v-spacer>
<v-spacer></v-spacer>
</v-toolbar>
</v-toolbar>
...
@@ -164,7 +164,7 @@ export default {
...
@@ -164,7 +164,7 @@ export default {
price
:
''
,
price
:
''
,
stock
:
''
,
stock
:
''
,
description
:
''
,
description
:
''
,
images
:
null
,
images
:
[]
,
variants
:
[
variants
:
[
{
{
color
:
""
,
color
:
""
,
...
@@ -283,15 +283,15 @@ export default {
...
@@ -283,15 +283,15 @@ export default {
},
},
createProduct
()
{
createProduct
()
{
const
self
=
this
;
const
self
=
this
;
const
set
=
new
Set
([
this
.
images
]);
//
const set = new Set([this.images]);
const
images
=
Array
.
from
(
set
);
//
const images = Array.from(set);
axios
axios
.
post
(
'
http://127.0.0.1:8000/api/products/
'
,{
.
post
(
'
http://127.0.0.1:8000/api/products/
'
,{
name
:
this
.
name
,
name
:
this
.
name
,
price
:
this
.
price
,
price
:
this
.
price
,
category_id
:
this
.
category_id
,
category_id
:
this
.
category_id
,
description
:
this
.
description
,
description
:
this
.
description
,
images
:
images
,
images
:
this
.
images
,
variants
:
this
.
variants
,
variants
:
this
.
variants
,
},
{
},
{
headers
:
{
headers
:
{
...
...
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