【发布时间】:2018-08-27 20:16:24
【问题描述】:
我使用 ionic start ionTutorial tabs 创建了 ionic 3 项目模板“标签”(生成的标签:主页/关于/联系人)
然后我添加了我自己的标签使用
ionic g 页面(标签:项目/通知/设置)。
然后我从 /src/pages 中删除了 home about 和 contact 文件夹
我更新了文件:tabs.html(仅更改了tabTitle 和tabIcon)和
tabs.ts
import { Component } from '@angular/core';
import { ProjectPage } from '../project/project';
import { NotificationsPage } from '../notifications/notifications';
import { SettingsPage } from '../settings/settings';
@Component({...})
export class TabsPage {
tab1Root = ProjectPage;
tab2Root = NotificationsPage;
tab3Root = SettingsPage;
constructor() { }
}
和 app.module.ts
//this was updated (3x import)
import { ProjectPage } from '../pages/project/project';
import { NotificationsPage } from '../pages/notifications/notifications';
import { SettingsPage } from '../pages/settings/settings';
import { TabsPage } from '../pages/tabs/tabs';
@NgModule({
declarations: [
MyApp,
ProjectPage, //this was updated
NotificationsPage, //this was updated
SettingsPage, //this was updated
TabsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
ProjectPage, //this was updated
NotificationsPage, //this was updated
SettingsPage, //this was updated
TabsPage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
我收到一个错误 错误:模块构建失败:错误:ENOENT:没有这样的文件或目录,打开 '\src\pages\about\about.ts'
之后我关闭了网络浏览器并尝试再次运行ionic serve,结果如下
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
watch started ...
build dev started ...
命令行“回来了”。
【问题讨论】: