小编And*_*rew的帖子

错误:未捕获(承诺)类型错误:n.swapComponent 不是函数

我正在使用带有 Jetsream 和 Vuejs & Inertia 堆栈的 Laravel 开发应用程序,并且在运行npm audit fix.

npm audit fix在收到消息说存在 3 个高危漏洞后,我运行了 npm 命令。这是输出:

npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN @inertiajs/inertia-vue@0.2.4 requires a peer of @inertiajs/inertia@^0.2.0 || ^0.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN …
Run Code Online (Sandbox Code Playgroud)

inertiajs npm laravel vue.js axios

4
推荐指数
1
解决办法
2398
查看次数

如何获取到期日期最接近当前日期的数据?

我有PurchaseOrderProduct模型从中获取类似的数据

PurchaseOrderProduct::with('products')
                     ->with('warehouse_locations')
                     ->with('productStatuses')
                     ->with('purchase_orders')
                     ->where('product_id', $request->product_id)
                     ->where('free_qty', '>=', 1)
                     ->get();
Run Code Online (Sandbox Code Playgroud)

现在在这个表中,我有一个expiry_date类型的列datei想要获取orderBy expiry_date最接近当前日期的数据。

意味着purchase_order_product到期日期最接近当前日期的应该排在第一位。

laravel eloquent laravel-query-builder laravel-8

3
推荐指数
1
解决办法
2750
查看次数

如何使用 TailwindCSS 更改网格行的背景颜色

是否有任何内置或简单的方法可以使用TailwindCSS 中的网格布局为交替网格行设置唯一的背景颜色?

可以说我有一个看起来像这样的网格:

<div class="grid grid-cols-6 gap-4">
    <div class="col-span-6">Row 1</div>
    <div class="col-span-3">Row 2 A</div>
    <div class="col-span-3">Row 2 B</div>
    <div class="col-span-6">Row 3</div>
    <div class="col-span-2">Row 4 A</div>
    <div class="col-span-2">Row 4 B</div>
    <div class="col-span-2">Row 4 C</div>
</div>
Run Code Online (Sandbox Code Playgroud)

有没有一种有效的方法可以将第 2 行和第 4 行的背景颜色设置为灰色 ( bg-gray-100)?我在文档中找不到任何内容,虽然我可以使用 Javascript 实现此目的,但我希望有一种仅使用 TailwindCSS 的更简单的方法。

tailwind-css

0
推荐指数
1
解决办法
6442
查看次数