Skip to content

Commit

Permalink
Optimize form error alert
Browse files Browse the repository at this point in the history
  • Loading branch information
jcc committed Jan 7, 2018
1 parent c2065c0 commit 6314fc2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions public/hot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hot reloading
2 changes: 1 addition & 1 deletion resources/assets/js/config/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function stack_error(response) {
if (typeof response.data == 'string') {
toastr.error(response.status + ' ' + response.statusText)
} else {
let data = response.data
let data = response.data.errors
let content = '';

Object.keys(data).map(function(key, index) {
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/views/dashboard/article/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,4 @@ export default {
}
}
}
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export default {
},
methods: {
username(value) {
return value.name
if (value) {
return value.data.name
}
},
tableActions(action, data) {
if (action == 'edit-item') {
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/views/dashboard/user/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row">
<form class="form col-md-4 col-md-offset-4" role="form" @submit.prevent="onSubmit">
<div class="form-group text-center">
<img :src="user.avatar ? user.avatar : 'https://pigjian.com/uploads/default_avatar.png'" id="avatar" class="img-circle" width="100" :alt="user.name">
<img :src="user.avatar ? user.avatar : '/images/default.png'" id="avatar" class="img-circle" width="100" :alt="user.name">
</div>
<div class="form-group">
<label for="name">{{ $t('form.name') }}</label>
Expand Down
11 changes: 5 additions & 6 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const path = require('path');
*/

mix.webpackConfig({
output: {

This comment has been minimized.

Copy link
@j574144

j574144 Jan 10, 2018

Hi.
Which is the reason for not use this?

This comment has been minimized.

Copy link
@jcc

jcc Jan 10, 2018

Author Owner

Oh, I need to use the npm run hot command. I forgot to undo. I am very so sorry.

publicPath: "/",
chunkFilename: 'js/[name].[chunkhash].js'
},
// output: {
// publicPath: "/",
// chunkFilename: 'js/[name].[chunkhash].js'
// },
resolve: {
alias: {
'components': 'assets/js/components',
Expand All @@ -37,5 +37,4 @@ mix.webpackConfig({
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.js('resources/assets/js/home.js', 'public/js')
.sass('resources/assets/sass/home.scss', 'public/css')
.version();
.sass('resources/assets/sass/home.scss', 'public/css');

0 comments on commit 6314fc2

Please sign in to comment.