【问题标题】:How can use Noty package with laravel 5.5如何在 laravel 5.5 中使用 Noty 包
【发布时间】:2018-03-31 05:56:54
【问题描述】:

我在控制器中使用了如下所示的会话

Session::flash('success', 'Profile updataed');

我已经导入以下文件

use Illuminate\Session\flash;
use Illuminate\Support\Facades\Session;

我已经运行了 npm install noty 命令

在我的资产文件夹 bootstrap.js 文件中包含

require('noty');

然后我在我的主布局文件中添加以下脚本代码

<script>
        @if(Session::has('success'))
            noty([
                type: 'success',
                layout: 'top',
                text: '{{ Session::get('success') }}'
                ]);
        @endif
    </script>

但它没有通知我我做错了什么

【问题讨论】:

    标签: laravel-5.5 noty


    【解决方案1】:

    noty docs 建议你创建一个类似的通知

    new Noty({
        ...
        text: 'Some notification text',
        ...
    }).show();
    

    【讨论】:

      猜你喜欢
      • 2018-04-20
      • 1970-01-01
      • 2019-07-30
      • 2018-08-30
      • 1970-01-01
      • 2018-04-05
      • 2018-08-01
      • 2018-03-12
      • 1970-01-01
      相关资源
      最近更新 更多