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
100f3021
Commit
100f3021
authored
Feb 01, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
onchangefile
parent
d318b797
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
index.vue
pages/posts/index.vue
+8
-2
axios.js
plugins/axios.js
+4
-4
No files found.
pages/posts/index.vue
View file @
100f3021
...
...
@@ -78,6 +78,7 @@
small-chips
dense
accept=
"image/*"
@
change=
"fileSelected"
/>
</v-col>
</v-row>
...
...
@@ -410,6 +411,7 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
file
:
null
,
dialog1
:
false
,
dialog2
:
false
,
title
:
''
,
...
...
@@ -417,7 +419,7 @@ export default {
content
:
''
,
user_id
:
''
,
status
:
null
,
images
:
null
,
images
:
[]
,
dialog
:
false
,
dialogDelete
:
false
,
headers
:
[
...
...
@@ -716,6 +718,10 @@ export default {
duration: 3000
})
})
},
fileSelected (event) {
console.log(event)
console.log(this.images)
}
}
}
...
...
plugins/axios.js
View file @
100f3021
export
default
function
({
$axios
},
inject
,
redirect
)
{
$axios
.
onError
(
error
=>
{
if
(
error
.
response
.
status
===
500
)
{
$axios
.
onError
(
(
error
)
=>
{
if
(
error
.
response
.
status
===
500
)
{
redirect
(
'
/500
'
)
}
})
$axios
.
onError
(
error
=>
{
$axios
.
onError
(
(
error
)
=>
{
const
code
=
parseInt
(
error
.
response
&&
error
.
response
.
status
)
if
(
code
===
400
)
{
redirect
(
'
/400
'
)
...
...
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