如何为默认方案添加颜色?这是我的 tailwindcss 文件。
const { colors: defaultColors } = require('tailwindcss/defaultTheme')
module.exports = {
"theme": {
"colors": defaultColors + {
"custom-yellow": {
"500": "#EDAE0A",
}
},
},
};
Run Code Online (Sandbox Code Playgroud) 我一直无法根据对象数组中的属性查询对象。
我正在尝试查询具有 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)