在Laravel 5.6中将JS代码从Blade文件移动到JS文件

时间:2018-09-23 08:38:22

标签: laravel

我是Laravel的新手。我需要将自由职业者在Blade文件中编写的JS代码移动到JS文件。

 @if(\Request::route()->getName() == 'profile')
      // Change Password
      @if ($errors->has('old_password') || $errors->has('password'))
        $('#changePassword').modal('show');
      @endif

  @if (\Session::has('pass_error'))
    $('#changePassword').modal('show'); 
  @endif
@endif
@if (Session::has('comment_error') || Session::has('comment_success'))
  $('#intrest').show();
  $('#intrest_comment').focus();
  $('html, body').animate({
      scrollTop: $("#intrest_comment").offset().top
  }, 1000);
 @endif

根据我的说法,可以将其移至JS文件。 Laravel无法实现的其他方法吗?

0 个答案:

没有答案