问题描述
你好,我想在我的Ionic 5项目中实现离子选框:https://www.npmjs.com/package/ionic-marquee
我按照所有步骤操作,出现错误
Can't bind to 'text' since it isn't a kNown property of 'ion-marquee'.
1. If 'ion-marquee' is an Angular component and it has 'text' input,then verify that it is part of this module.
我认为问题在于字幕仅在Ionic 3中起作用,因为Ionic 5中不推荐使用Ion-native,因此我更改了模块 来自
import { IonicModule } from 'ionic-angular';
到
import { IonicModule } from '@ionic/angular';
但仍然错误。
这是代码
app.module.ts ... 从“ ionic-marquee”导入{IonMarqueeModule};
@NgModule({
...
imports: [
IonMarqueeModule,...
],...
})
export class AppModule {}
home.ts
export class YourPage implements OnInit {
horizontalText = `this is the text to show scroll horizontal,and default is scroll horizontal. you don't need to set the direction`;
constructor(public navCtrl: NavController) {}
ngOnInit() {
setTimeout(() => {
this.horizontalText = `this is the text to show that text Could be refreshed.
but this feature support horizontal scroll only!`;
},5000);
}
}
html
<ion-marquee speed="30" style="height: 24px" [text]="horizontalText">
</ion-marquee>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)