小编ggo*_*don的帖子

如何向tailwind-css添加新颜色并保留原始颜色?

如何为默认方案添加颜色?这是我的 tailwindcss 文件。

const { colors: defaultColors } = require('tailwindcss/defaultTheme')

module.exports = {
    "theme": {
        "colors": defaultColors + {
            "custom-yellow": {
                "500": "#EDAE0A",
            }
        },
    },
};
Run Code Online (Sandbox Code Playgroud)

tailwind-css

11
推荐指数
5
解决办法
1万
查看次数

环回 4:如何查询对象数组

我一直无法根据对象数组中的属性查询对象。

我正在尝试查询具有 ID 为 7 的事件的所有订单:

  const orders = await this.orderRepository.find({where: {events: {elemMatch: {'id': event.id}}}});
Run Code Online (Sandbox Code Playgroud)

以上给了我以下错误:

 ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''{\"id\":\"7\"}
Run Code Online (Sandbox Code Playgroud)

如果我尝试以下过滤器,我总是会得到一个空数组:

{where: {events: {like: '%id%'}}}
Run Code Online (Sandbox Code Playgroud)

Loopback 4 的正确方法是什么?

更新:

我正在使用 MySQL 8.0。

这是我的订单模型中事件的定义:

@property({
  type: 'array',
  itemType: 'object',
  required: false,
})
events: CartItem[] | null;
Run Code Online (Sandbox Code Playgroud)

mysql loopback4

5
推荐指数
1
解决办法
401
查看次数

标签 统计

loopback4 ×1

mysql ×1

tailwind-css ×1