ionic3 新建组件 提示 ion-xxx is not a known element
通过ionic g componennt xxx 创建一个组件,然后在组件中的html中写的ion-xxx标签 会提示未知元素,
解决方法:
在components.module.ts中引入
import { NgModule } from '@angular/core';
import { NavbarComponent } from './navbar/navbar';
import { IonicModule } from 'ionic-angular';
@NgModule({
declarations: [NavbarComponent],
imports: [
IonicModule
],
exports: [NavbarComponent]
})
export class ComponentsModule { }
喜欢的话,请点赞,转发、收藏、评论,谢谢!

浙公网安备 33010602011771号