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 @@
min=
"1"
required
/>
<label>
Parent ID :
</label>
<input
type=
"text"
class=
"form-control mb-2"
placeholder=
"Parent ID"
v-model=
"parent_id"
/>
<label>
Parent :
</label>
<b-form-select
v-model=
"parent_id"
>
<option
v-for=
"item in categories"
:value=
"item.id"
>
{{
item
.
name
}}
</option>
</b-form-select>
<label>
Ordering :
</label>
<input
type=
"text"
...
...
@@ -38,7 +37,6 @@
v-model=
"ordering"
required
/>
<b-form-select
v-model=
"selected"
:options=
"options"
></b-form-select>
<label>
Image :
</label>
<b-form-file
@
change=
"fileSelected"
...
...
@@ -205,7 +203,7 @@ export default {
middleware
:
[
"
web
"
],
data
:
()
=>
{
return
{
parent_id
:
''
,
parent_id
:
null
,
name
:
''
,
ordering
:
''
,
image
:
null
,
...
...
@@ -320,13 +318,15 @@ export default {
});
},
createCategory
()
{
const
self
=
this
const
set
=
new
Set
([
this
.
image
]);
const
image
=
Array
.
from
(
set
);
const
self
=
this
;
axios
.
post
(
'
http://127.0.0.1:8000/api/categories/
'
,{
name
:
this
.
name
,
ordering
:
this
.
ordering
,
parent_id
:
this
.
parent_id
,
image
:
this
.
image
,
image
:
image
,
},
{
headers
:
{
"
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