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
9201a8ba
Commit
9201a8ba
authored
Jan 16, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add select parent_id
parent
5d98f35a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
categories.vue
pages/home/categories.vue
+11
-11
No files found.
pages/home/categories.vue
View file @
9201a8ba
...
@@ -23,13 +23,12 @@
...
@@ -23,13 +23,12 @@
min=
"1"
min=
"1"
required
required
/>
/>
<label>
Parent ID :
</label>
<label>
Parent :
</label>
<input
<b-form-select
v-model=
"parent_id"
>
type=
"text"
<option
v-for=
"item in categories"
:value=
"item.id"
>
class=
"form-control mb-2"
{{
item
.
name
}}
placeholder=
"Parent ID"
</option>
v-model=
"parent_id"
</b-form-select>
/>
<label>
Ordering :
</label>
<label>
Ordering :
</label>
<input
<input
type=
"text"
type=
"text"
...
@@ -38,7 +37,6 @@
...
@@ -38,7 +37,6 @@
v-model=
"ordering"
v-model=
"ordering"
required
required
/>
/>
<b-form-select
v-model=
"selected"
:options=
"options"
></b-form-select>
<label>
Image :
</label>
<label>
Image :
</label>
<b-form-file
<b-form-file
@
change=
"fileSelected"
@
change=
"fileSelected"
...
@@ -205,7 +203,7 @@ export default {
...
@@ -205,7 +203,7 @@ export default {
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
parent_id
:
''
,
parent_id
:
null
,
name
:
''
,
name
:
''
,
ordering
:
''
,
ordering
:
''
,
image
:
null
,
image
:
null
,
...
@@ -320,13 +318,15 @@ export default {
...
@@ -320,13 +318,15 @@ export default {
});
});
},
},
createCategory
()
{
createCategory
()
{
const
self
=
this
const
set
=
new
Set
([
this
.
image
]);
const
image
=
Array
.
from
(
set
);
const
self
=
this
;
axios
axios
.
post
(
'
http://127.0.0.1:8000/api/categories/
'
,{
.
post
(
'
http://127.0.0.1:8000/api/categories/
'
,{
name
:
this
.
name
,
name
:
this
.
name
,
ordering
:
this
.
ordering
,
ordering
:
this
.
ordering
,
parent_id
:
this
.
parent_id
,
parent_id
:
this
.
parent_id
,
image
:
this
.
image
,
image
:
image
,
},
{
},
{
headers
:
{
headers
:
{
"
Content-Type
"
:
"
multipart/form-data
"
,
"
Content-Type
"
:
"
multipart/form-data
"
,
...
...
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