小编Tho*_*Kim的帖子

如何在不丢失纵横比的情况下将图像填充到 ion-img 中的整个空间?

我目前的进展停留在这样的事情上。我需要帮助

在此处输入图片说明

我需要 ion-img 中的图片来填充其容器而不会丢失其外观。这是我的 html 代码

<ion-col class='left-content'>
  <ion-img [src]='voucher.image'></ion-img>
</ion-col>
Run Code Online (Sandbox Code Playgroud)

这是我的 scss 代码

ion-img {
  min-width: 5.7em;
  min-height: 5.7em;
  border-radius: 0.5em;
  @include my-img-shadow();
}

.left-content {
  padding-top: 0.8em;
  position: absolute;
  left: 0.5em;
}
Run Code Online (Sandbox Code Playgroud)

ionic-framework ionic2 ionic3

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

MongoDB $lookup 对一个文档的对象数组进行查找

我在网上搜索过,但找不到与我的情况相符的内容。情况是这样的。

我正在使用聚合将一个集合和来自另一个集合的一个文档组合在一起

restaurants.aggregate([
  {
    $match: {
      _id: {
        $in: idList
      }
    }
  },
  {
    $lookup: {
      from: "tags",
      localField: "details.restaurantType",
      foreignField: "details.restaurantType._id",
      as: "types"
    }
  },
  {
    $project: {
      restaurantName: "$details.restaurantName",
      restaurantType: "$details.restaurantType",
      type: {
        $filter: {
          input: "$types",
          as: "type",
          cond: {
            $eq: ["$$type._id", "$details.restaurantType"]
          }
        }
      },
      currency: "$details.currency",
      costPerPax: "$details.costPerPax"
    }
  }
]);
Run Code Online (Sandbox Code Playgroud)

当前结果

我当前结果中的“类型”字段是 [],我需要一个匹配的值

[
    {
        "id": "5c20c7a0036dda80a8baabcc",
        "restaurantName": "Villagio Restaurant Sutera Mall",
        "type": [],
        "currency": "RM",
        "costPerPax": 22,
    },
    {
        "id": "5c20ceb07715216d3c217b7a",
        "restaurantName": "Thai …
Run Code Online (Sandbox Code Playgroud)

mongodb node.js mongodb-query aggregation-framework

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

Ionic 5 电容器 Android 项目不同步

Android studio 不断构建第一个 Android 项目并将其安装到设备中。

我努力了

npx cap sync

npx cap copy android
Run Code Online (Sandbox Code Playgroud)

甚至删除/android文件夹并重新添加。该项目仍然是我第一次添加到android studio时的情况。我尝试过“Gradle 同步”和“无效缓存/重新启动”仍然没有成功。

我已将项目资源图标和启动画面更新为自定义图标,但 Android 项目仍然使用电容器默认图标和启动画面。以前有人遇到过这个问题吗?

android-studio ionic-framework capacitor ionic5

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