PrimeNG Galleria 组件显示错误消息

huangapple go评论49阅读模式
英文:

Error message when displaying PrimeNG Galleria component

问题

我最近升级了我的Angular应用到版本16,所以我也升级了我的PrimeNg组件。我目前正在使用版本16.0.0-rc.2(唯一一个可以安装在Angular 16上的版本),我遇到了以下错误消息,并且组件无法正常工作:

PrimeNG Galleria 组件显示错误消息

这个错误是由以下代码生成的:

<p-galleria [value]="images" [responsiveOptions]="responsiveOptions" [containerStyle]="{ 'max-width': '640px' }" [numVisible]="5">
    <ng-template pTemplate="item" let-item>
        <img [src]="item.itemImageSrc" style="width:490px; height: 480px;" />
    </ng-template>
    <ng-template pTemplate="thumbnail" let-item>
        <div class="grid grid-nogutter justify-content-center">
            <img [src]="item.thumbnailImageSrc" style="width:80px; height: 60px;" />
        </div>
    </ng-template>
</p-galleria>

如果我注释掉这个HTML元素,错误就消失了。

感谢任何关于如何解决这个问题的建议。

英文:

I recently upgraded my angular app to version 16 so I also upgraded my PrimeNg components. I am currently using version 16.0.0-rc.2 ( the only version that would install on angular 16) and I am running in the following error message and the component does not work:

PrimeNG Galleria 组件显示错误消息

It is generated by this:

 &lt;p-galleria [value]=&quot;images&quot; [responsiveOptions]=&quot;responsiveOptions&quot; [containerStyle]=&quot;{ &#39;max-width&#39;: &#39;640px&#39; }&quot; [numVisible]=&quot;5&quot;&gt;
                &lt;ng-template pTemplate=&quot;item&quot; let-item&gt;
                    &lt;img [src]=&quot;item.itemImageSrc&quot; style=&quot;width:490px; height: 480px;&quot; /&gt;
                &lt;/ng-template&gt;
                &lt;ng-template pTemplate=&quot;thumbnail&quot; let-item&gt;
                    &lt;div class=&quot;grid grid-nogutter justify-content-center&quot;&gt;
                        &lt;img [src]=&quot;item.thumbnailImageSrc&quot; style=&quot;width:80px; height: 60px;&quot; /&gt;
                    &lt;/div&gt;
                &lt;/ng-template&gt;
            &lt;/p-galleria&gt;

If I comment out the html element, the error goes away.

Thanks for any suggestion on how to address this issue.

答案1

得分: 0

我遇到了与primeng 16.0.0相同的问题,升级到primeng 16.0.1后,问题消失了。

英文:

I had the same problem with primeng 16.0.0, and after upgrading to primeng 16.0.1, the problem disappeared.

答案2

得分: 0

我遇到了与p-galleria相同的问题。只需将primeNg版本从&quot;primeng&quot;: &quot;^16.0.0-rc.2&quot;更新到&quot;primeng&quot;: &quot;^16.0.1&quot;,这个问题就消失了。

英文:

I had same problem with p-galleria. Just update primeNg version &quot;primeng&quot;: &quot;^16.0.0-rc.2&quot; to &quot;primeng&quot;: &quot;^16.0.1&quot;, this problem disappeared.

huangapple
  • 本文由 发表于 2023年6月12日 04:32:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76452415.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定