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
fd1a54b9
Commit
fd1a54b9
authored
Jan 16, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ident
parent
209387e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
53 deletions
+13
-53
categories.vue
pages/home/categories.vue
+6
-22
index.vue
pages/home/index.vue
+2
-12
users.vue
pages/home/users.vue
+5
-15
index.vue
pages/index.vue
+0
-4
No files found.
pages/home/categories.vue
View file @
fd1a54b9
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
placeholder=
"Parent ID"
placeholder=
"Parent ID"
v-model=
"parent_id"
v-model=
"parent_id"
/>
/>
<label>
Ordering :
</label>
<label>
Ordering :
</label>
<input
<input
type=
"text"
type=
"text"
...
@@ -48,7 +47,6 @@
...
@@ -48,7 +47,6 @@
placeholder=
"Choose a image or drop it here..."
placeholder=
"Choose a image or drop it here..."
drop-placeholder=
"Drop file here..."
drop-placeholder=
"Drop file here..."
></b-form-file>
></b-form-file>
</form>
</form>
</p>
</p>
<template
#modal-footer
>
<template
#modal-footer
>
...
@@ -76,7 +74,6 @@
...
@@ -76,7 +74,6 @@
placeholder=
"Parent ID"
placeholder=
"Parent ID"
v-model=
"eParent_id"
v-model=
"eParent_id"
/>
/>
<label>
Ordering :
</label>
<label>
Ordering :
</label>
<input
<input
type=
"text"
type=
"text"
...
@@ -92,7 +89,6 @@
...
@@ -92,7 +89,6 @@
placeholder=
"Choose a image or drop it here..."
placeholder=
"Choose a image or drop it here..."
drop-placeholder=
"Drop file here..."
drop-placeholder=
"Drop file here..."
></b-form-file>
></b-form-file>
</form>
</form>
</p>
</p>
<
template
#modal-footer
>
<
template
#modal-footer
>
...
@@ -101,7 +97,6 @@
...
@@ -101,7 +97,6 @@
</
template
>
</
template
>
</b-modal>
</b-modal>
<div>
<div>
<v-data-table
<v-data-table
:headers=
"headers"
:headers=
"headers"
:items=
"categories"
:items=
"categories"
...
@@ -120,7 +115,6 @@
...
@@ -120,7 +115,6 @@
<v-card-title>
<v-card-title>
<span
class=
"text-h5"
>
{{ formTitle }}
</span>
<span
class=
"text-h5"
>
{{ formTitle }}
</span>
</v-card-title>
</v-card-title>
<v-card-text>
<v-card-text>
<v-container>
<v-container>
<v-row>
<v-row>
...
@@ -157,7 +151,6 @@
...
@@ -157,7 +151,6 @@
</v-row>
</v-row>
</v-container>
</v-container>
</v-card-text>
</v-card-text>
<v-card-actions>
<v-card-actions>
<v-spacer></v-spacer>
<v-spacer></v-spacer>
<v-btn
color=
"blue darken-1"
text
@
click=
"close"
>
<v-btn
color=
"blue darken-1"
text
@
click=
"close"
>
...
@@ -194,14 +187,8 @@
...
@@ -194,14 +187,8 @@
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
</
template
>
</
template
>
</v-data-table>
</v-data-table>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
...
@@ -216,7 +203,6 @@ export default {
...
@@ -216,7 +203,6 @@ export default {
components
:
{
Navigation
},
components
:
{
Navigation
},
components
:
{
notification
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
parent_id
:
''
,
parent_id
:
''
,
...
@@ -256,7 +242,6 @@ export default {
...
@@ -256,7 +242,6 @@ export default {
status
:
""
,
status
:
""
,
created_at
:
""
,
created_at
:
""
,
updated_at
:
""
,
updated_at
:
""
,
},
},
defaultItem
:
{
defaultItem
:
{
name
:
""
,
name
:
""
,
...
@@ -370,9 +355,9 @@ export default {
...
@@ -370,9 +355,9 @@ export default {
this
.
image
=
file
;
this
.
image
=
file
;
console
.
log
(
file
)
console
.
log
(
file
)
console
.
log
(
this
.
image
)
console
.
log
(
this
.
image
)
},
},
deleteCategory
(
ID
,
index
)
{
deleteCategory
(
ID
,
index
)
{
const
self
=
this
this
.
editedIndex
=
this
.
categories
.
indexOf
(
index
);
this
.
editedIndex
=
this
.
categories
.
indexOf
(
index
);
if
(
confirm
(
"
Do you really want to delete?
"
)){
if
(
confirm
(
"
Do you really want to delete?
"
)){
try
{
try
{
...
@@ -380,12 +365,14 @@ export default {
...
@@ -380,12 +365,14 @@ export default {
.
delete
(
`http://127.0.0.1:8000/api/categories/
${
ID
}
`
)
.
delete
(
`http://127.0.0.1:8000/api/categories/
${
ID
}
`
)
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
categories
.
splice
(
this
.
editedIndex
,
1
);
this
.
categories
.
splice
(
this
.
editedIndex
,
1
);
self
.
$toast
.
success
(
'
Category deleted successfully!
'
,{
duration
:
3000
});
})
})
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
error
)
console
.
log
(
error
)
}
}
}
}
},
},
getID
(
item
)
{
getID
(
item
)
{
console
.
log
(
this
.
categories
.
indexOf
(
item
))
console
.
log
(
this
.
categories
.
indexOf
(
item
))
...
@@ -423,9 +410,6 @@ export default {
...
@@ -423,9 +410,6 @@ export default {
console.log(error)
console.log(error)
}
}
}
}
},
},
};
};
</
script
>
</
script
>
\ No newline at end of file
pages/home/index.vue
View file @
fd1a54b9
<
template
>
<
template
>
<div>
<div>
<div>
<div>
<h1
style=
"text-align: center"
>
HOME
</h1>
<h1
style=
"text-align: center"
>
HOME
</h1>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
onMounted
}
from
"
vue
"
;
import
{
onMounted
}
from
"
vue
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
VueAxios
from
"
vue-axios
"
;
import
VueAxios
from
"
vue-axios
"
;
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
export
default
{
export
default
{
layout
:
"
admin
"
,
layout
:
"
admin
"
,
components
:
{
Nav
},
components
:
{
Nav
},
middleware
:
[
'
web
'
],
middleware
:
[
'
web
'
],
};
};
</
script
>
</
script
>
<
style
></
style
>
<
style
></
style
>
pages/home/users.vue
View file @
fd1a54b9
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
v-model=
"email"
v-model=
"email"
required
required
/>
/>
<label>
Password :
</label>
<label>
Password :
</label>
<input
<input
type=
"password"
type=
"password"
...
@@ -43,7 +42,6 @@
...
@@ -43,7 +42,6 @@
v-model=
"password"
v-model=
"password"
required
required
/>
/>
</form>
</form>
</p>
</p>
<template
#modal-footer
>
<template
#modal-footer
>
...
@@ -73,7 +71,6 @@
...
@@ -73,7 +71,6 @@
v-model=
"eEmail"
v-model=
"eEmail"
required
required
/>
/>
<label>
Password :
</label>
<label>
Password :
</label>
<input
<input
type=
"password"
type=
"password"
...
@@ -193,8 +190,7 @@
...
@@ -193,8 +190,7 @@
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
</
template
>
</
template
>
</v-data-table>
</v-data-table>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
...
@@ -209,8 +205,7 @@ export default {
...
@@ -209,8 +205,7 @@ export default {
components
:
{
Nav
},
components
:
{
Nav
},
components
:
{
Navigation
},
components
:
{
Navigation
},
components
:
{
notification
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
email
:
''
,
email
:
''
,
...
@@ -349,8 +344,7 @@ export default {
...
@@ -349,8 +344,7 @@ export default {
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
duration
:
3000
duration
:
3000
});
});
});
});
},
},
deleteUser
(
userID
)
{
deleteUser
(
userID
)
{
if
(
confirm
(
"
Do you really want to delete?
"
)){
if
(
confirm
(
"
Do you really want to delete?
"
)){
...
@@ -361,9 +355,7 @@ export default {
...
@@ -361,9 +355,7 @@ export default {
console
.
log
(
error
)
console
.
log
(
error
)
}
}
}
}
},
},
editUser
(
userID
)
{
editUser
(
userID
)
{
this
.
$bvModal
.
show
(
'
modal-edit
'
);
this
.
$bvModal
.
show
(
'
modal-edit
'
);
this
.
eID
=
userID
;
this
.
eID
=
userID
;
...
@@ -390,9 +382,7 @@ export default {
...
@@ -390,9 +382,7 @@ export default {
} catch(error){
} catch(error){
console.log(error)
console.log(error)
}
}
}
}
},
},
};
};
</
script
>
</
script
>
pages/index.vue
View file @
fd1a54b9
...
@@ -118,21 +118,17 @@ export default {
...
@@ -118,21 +118,17 @@ export default {
this
.
$router
.
push
(
"
/
"
);
this
.
$router
.
push
(
"
/
"
);
}
}
},
},
checkForm
:
function
(
e
)
{
checkForm
:
function
(
e
)
{
if
(
this
.
name
&&
this
.
age
)
{
if
(
this
.
name
&&
this
.
age
)
{
return
true
;
return
true
;
}
}
this
.
errors
=
[];
this
.
errors
=
[];
if
(
!
this
.
name
)
{
if
(
!
this
.
name
)
{
this
.
errors
.
push
(
"
Name required.
"
);
this
.
errors
.
push
(
"
Name required.
"
);
}
}
if
(
!
this
.
age
)
{
if
(
!
this
.
age
)
{
this
.
errors
.
push
(
"
Age required.
"
);
this
.
errors
.
push
(
"
Age required.
"
);
}
}
e
.
preventDefault
();
e
.
preventDefault
();
},
},
},
},
...
...
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