gpt4 book ai didi

ionic-framework - 找不到 ionic 角模块

转载 作者:行者123 更新时间:2023-12-02 16:53:09 26 4
gpt4 key购买 nike

我正在学习 Ionic v4,模板已成功编译。但是当我将这些模板更改为像下面这样的组件示例时,它会出现我在下面提到的错误。

我做错了什么?如果我做的测试alert的流程是错误的,我该如何在ionic中测试代码和添加页面?

如果有人能帮助我学习使用ionic,我将不胜感激。我有项目要在 2 周内交付谢谢

import { Component } from '@angular/core';

import { AlertController } from 'ionic-angular';


@Component({
templateUrl: 'template.html'
})
export class BasicPage {

constructor(public alerCtrl: AlertController) { }

doAlert() {
let alert = this.alerCtrl.create({
title: 'New Friend!',
message: 'Your friend, Obi wan Kenobi, just approved your
friend request!',
buttons: ['Ok']
});
alert.present()
}

}

ERROR in ./src/app/tab3/tab3.module.ts 16:58- 66 [ng] "export 'Tab3Page' was not found in './tab3.page' [ng] ERROR in ./src/app/tab3/tab3.module.ts 18:23- 31 [ng] "export 'Tab3Page' was not found in './tab3.page' [ng] ERROR in ./src/app/tab3/tab3.page.ts [ng] Module not found: ./src/app/tab3/tab3.page.ts [ng] Module not found: Error: Can't resolve 'ionic-angular' in 'C:\Users\ASUS\Ionic\ app\src\app\tab3' [ng] Time: 797ms [ng] i 「wdm」: Failed to compile. [ng] [ng] ERROR in src/app/tab3/tab3.module.ts(6,10): error TS2305: Module '"C:/Users/ASUS/Ionic/app /src/app/tab3/tab3.page"' has no exported member 'Tab3Page'. [ng] src/app/tab3/tab3.page.ts(3,33): error TS2307: Cannot find module 'ionic-angular'**

最佳答案

Ionic4 中有各种更新。

import { AlertController } from '@ionic/angular';  // Ionic 4

import { AlertController } from 'ionic/angular'; // Ionic 3

关于ionic-framework - 找不到 ionic 角模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57554280/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com