小编Mar*_*pez的帖子

regeneratorRuntime未定义(如何防止babel包含该polyfill?)

我继续得到:

App.jsx:11未捕获的ReferenceError:未定义regeneratorRuntime

在执行异步的任何行上。我没有那个polyfill,但是我很难摆脱它:

app.jsx:11)

 const fetcher = (async () => {

Run Code Online (Sandbox Code Playgroud)
  "@babel/cli": "^7.4.4",
   "@babel/core": "^7.4.4",
   "@babel/preset-env": "^7.4.4",
   "@babel/preset-react": "^7.0.0",
   "@types/react": "^16.8.17",
   "babel-preset-env": "^1.7.0"
Run Code Online (Sandbox Code Playgroud)

这里是 .babelrc

{
    "presets": [
        [
            "@babel/preset-env",
            {
                "targets": {
                    "chrome": ">70",
                },
                "exclude": ["transform-regenerator"]
            },
            "@babel/preset-react"
        ]
    ]
}
Run Code Online (Sandbox Code Playgroud)

babeljs

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

如何在 <ion-img> 上设置高度

我有一个离子页面,里面有一个ion-img

<ion-content>
  <ion-grid>
    <ion-row class="ion-padding" align-items-center justify-content-center>
      <ion-item>
        <ion-label text-wrap class="ion-text-center">
          Servicio de reportes
        </ion-label>
      </ion-item>
    </ion-row>
    <ion-row align-items-center justify-content-center >
      <ion-button size="smaill" type="submit" expand="block" routerDirection="forward" (click)="selectSource()" >Capturar imagen</ion-button>
    </ion-row>
    <ion-row>
      <ion-col>

        <ion-img [src]="selectedImage" *ngIf="selectedImage"> </ion-img>

      </ion-col>
    </ion-row>
  </ion-grid>
</ion-content>
Run Code Online (Sandbox Code Playgroud)

当图片设置为selectedImage 时它会占据整个屏幕甚至更多。我必须滚动才能看到完整的图像。

我希望图像占据屏幕的 20% 或固定高度。

我试图在 css 中做到这一点:

ion-grid {
  height: 100%;

  ion-row {
    max-height: 33.33%;
  }
}
Run Code Online (Sandbox Code Playgroud)

而且我还尝试使用 height 属性:

 <ion-img height: 10rem; [src]="selectedImage" *ngIf="selectedImage"> </ion-img>
Run Code Online (Sandbox Code Playgroud)

并且图像继续占据相同的空间

我该怎么做?感谢帮助。

html css image ionic-framework ionic4

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

如何在应用程序属性中设置文件位置 - Spring boot

我有一个 Spring Boot 应用程序,代码需要访问资源/模板文件夹下的文件。这是我的 application.properties 文件:

    pont.email.template.location=templates/mailTemplate.html
Run Code Online (Sandbox Code Playgroud)

这是我使用变量的java文件:

    @Value("${pont.email.template.location}") 
    private String templateLocation;
    ----------------
    BufferedReader reader = new BufferedReader(new FileReader(templateLocation));
Run Code Online (Sandbox Code Playgroud)

问题不是获取变量,而是正确返回,问题是应用程序没有找到该路径的任何文件。

我总是得到

    java.io.FileNotFoundException: templates/mailTemplate.html (No such file or directory)
Run Code Online (Sandbox Code Playgroud)

我已经检查过文件在路径中..

我的代码有什么问题?请帮忙,谢谢。

properties path spring-boot

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

标签 统计

babeljs ×1

css ×1

html ×1

image ×1

ionic-framework ×1

ionic4 ×1

path ×1

properties ×1

spring-boot ×1