ionic5 - ng-lottie 和 ngx-lottie 在 ionic-5 中不起作用
问题描述
我正在将 lottie 飞溅动画集成到 ionic 5 框架中的组件中。
我已经使用npm install --save ng-lottie
并按照文档https://www.npmjs.com/package/ng-lottie中的步骤安装了 ng-lottie 。但是,它显示以下错误。请帮我解决这个问题。
Uncaught Error: Template parse errors:
Can't bind to 'options' since it isn't a known property of 'lottie-animation-view'.
1. If 'lottie-animation-view' is an Angular component and it has 'options' input, then verify that it is part of this module.
2. If 'lottie-animation-view' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<lottie-animation-view
[ERROR ->][options]="lottieConfig"
[width]="300"
[height]="600"
"): ng:///SsoModule/SsoComponent.html@13:20
Can't bind to 'width' since it isn't a known property of 'lottie-animation-view'.
解决方案
您还必须在'.module.ts
组件中导入 LottieModule
@NgModule({
imports: [
***,
LottieModule
],
推荐阅读
- windows - 批处理错误:“此时不应出现<”
- python - 两个列表之间的值差异
- file-upload - 如何使用终端将文件直接上传和下载到虚拟服务器
- python - 在列表的for循环内修改列表时出现奇怪的输出
- java - 给定大小为 N 的数组中 n 个数字的最小总和,其间有 k 个空格
- c - 在 C 中实现偏执数组
- python-3.x - 如何使用 __add__ 方法在 python 中添加 2 个向量?
- python - 散景图不会在 dropdown.on_change 上更新
- c++ - 为什么子类的子类不能访问其祖先的受保护成员?
- database - 在postgresql中,导入csv文件后,序列号不同步