小编Sha*_*yal的帖子

流明中的路由组错误调用未定义方法Laravel \ Lumen \ Application :: group()

我在laravel / lumen中声明了一个路由组,如下所示:

$app->group(['middleware' => 'auth'], function () use ($app) {
    $app->get('/details', 'UserController@details');
});
Run Code Online (Sandbox Code Playgroud)

路由文件web.php的所有内容如下:

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app = app();

$router->get('/', function () use ($router) {
    return $router->app->version();
});


$app->group(['middleware' => 'auth'], …
Run Code Online (Sandbox Code Playgroud)

php routing laravel lumen lumen-5.2

5
推荐指数
2
解决办法
6807
查看次数

在javascript中查找所有嵌套数组中的Max和Min元素

我有一个像这样的数组:

var arr = [[12,45,75], [54,45,2],[23,54,75,2]];
Run Code Online (Sandbox Code Playgroud)

我想找出嵌套数组中所有元素中最大的元素和最小的元素:

分钟应该是:2

马克斯应该是75

我尝试了下面的功能,但它们不起作用:

    function Max(arrs)
    {
        if (!arrs || !arrs.length) return undefined;
        let max = Math.max.apply(window, arrs[0]), m,
            f = function(v){ return !isNaN(v); };
        for (let i = 1, l = arrs.length; i<l; i++) {
            if ((m = Math.max.apply(window, arrs[i].filter(f)))>max) max=m;
        }
        return max;
    }
    function Min(arrs)
    {
        if (!arrs || !arrs.length) return undefined;
        let min = Math.min.apply(window, arrs[0]), m,
            f = function(v){ return !isNaN(v); };
        for (let i = 1, l …
Run Code Online (Sandbox Code Playgroud)

javascript arrays max min

4
推荐指数
2
解决办法
1426
查看次数

数学函数在Angle 4 HTML中不起作用

使用以下行:

<div class="card light-blue darken-4" [ngClass]="'card-grad-'+Math.floor(Math.random() * 10) + 1">
Run Code Online (Sandbox Code Playgroud)

给出以下错误:

ERROR TypeError: Cannot read property 'floor' of undefined
Run Code Online (Sandbox Code Playgroud)

和component.ts。

怎么解决呢?

甚至尝试使用decare var Math:any,也尝试在类中定义数学,但徒劳无功。

javascript angular

2
推荐指数
2
解决办法
2784
查看次数

标签 统计

javascript ×2

angular ×1

arrays ×1

laravel ×1

lumen ×1

lumen-5.2 ×1

max ×1

min ×1

php ×1

routing ×1