我最近克隆了一个项目,当我尝试服务它时,我收到了一个错误:TypeError: AppScripts.serve is not a function.
我该如何解决这个问题?我应该在哪里看?
我已经尝试更新离子,并重新安装所有插件(以防万一).
对此的协助将不胜感激!
我正在使用离子3.
这是我的模板
<ion-slides autoplay="5000" loop="true" speed="500" class="slides" pager="true">
<ion-slide *ngFor="let Image of PImage">
<img src="{{Image.URL}}" alt="Product Image">
</ion-slide>
</ion-slides>
Run Code Online (Sandbox Code Playgroud)
但是我收到了这个错误
TypeError: Cannot read property 'hasAttribute' of undefined
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
请告诉我,
谢谢
我的要求是将应用程序固定为手机上的纵向模式和选项卡上的横向模式,从闪屏开始。尝试使用 ionic native 上可用的 Screen Orientation 插件,但对我不起作用。
我尝试过的事情:
在 app.component.ts 上:
constructor(..., private screenOrientation: ScreenOrientation) {
platform.ready().then(() => {
this.screenOrientation.lock('landscape');
ScreenOrientation.lockOrientation('landscape');
screen.msLockOrientation('landscape');
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
Run Code Online (Sandbox Code Playgroud)
我也在 home.ts 上尝试了上述所有行,但没有奏效。当我设置:
console.log(this.screenOrientation.type);
Run Code Online (Sandbox Code Playgroud)
这将在日志中正确打印出屏幕方向。每当我设置 subscribe 方法时,它也会在屏幕方向发生变化时提醒我,这意味着所有导入语句都可以正常工作并且我能够正确访问插件方法。我能够在 Android 和 iOS 上复制这个问题。任何帮助将不胜感激。
平台/库/依赖项详细信息:
"@angular/common": "4.1.3",
“离子角”:“3.6.0”,
“离子”:“3.7.0”
突然,当我从 Xcode 构建和运行我的 Ionic 3 应用程序时,我收到了这样的错误,对于所有的cordova 插件:
WARN: Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed.
WARN: Install the StatusBar plugin: 'ionic plugin add cordova-plugin-statusbar'
Run Code Online (Sandbox Code Playgroud)
到目前为止它工作正常,我不明白为什么现在会发生这种情况以及如何补救(重新安装除外)。
即使它们在 package.json 和 config.xml 中都很好地列出。
我想禁用从左上角开始打开Popover的动画.相反,我希望它在我"解散"时以相同的方式打开,这是一种整个元素的FadeOut.
我无法做到这一点.目前尚不清楚我是否可以将任何选项传递给"创建"方法.
非常感谢.
我想将我的 Ionic 应用程序托管到 firebase 托管。现在,当我运行firebase deploy命令时,出现以下错误
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: `tslint -p tslint.json && ./node_modules/.bin/tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Error: functions predeploy command terminated with non-zero exit code1
Run Code Online (Sandbox Code Playgroud)
我缺少什么才能正常工作
我正在尝试在顶部工具栏和底部选项卡区域之间放置一个。我需要它在 iPhone 5-X 和 iOS 10-11 上运行。如果你忽略iOS10,那么不存在问题,但我还需要旧版本才能工作。这是我的 CSS。“margin-top”给出了 iOS 10 的错误。如果我使用“padding-top”那么它在 iPhone X 上不起作用。这是 LoadingController 封面,所以我不想以编程方式从 JS 到HTML(老实说,不知道如何访问用于加载控制器的 HTML)。我已经为谷歌地图以编程方式解决了这个问题,但想知道是否有通过 CSS 的解决方案?我已经获得了所有东西和 WKWebView 的所有最新版本。我的离子观点如下。
.loading-ios {
margin-top: constant(safe-area-inset-top);
margin-top: env(safe-area-inset-top);
margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom);
background-color: white;
opacity: 1 !important;
position: absolute;
top: 64px;
bottom: 49px;
}
Run Code Online (Sandbox Code Playgroud)
cli包:
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
Run Code Online (Sandbox Code Playgroud)
全局包:
cordova (Cordova CLI) : 7.1.0
Run Code Online (Sandbox Code Playgroud)
本地包:
@ionic/app-scripts : 1.3.12
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
Run Code Online (Sandbox Code Playgroud)
系统:
ios-deploy : 1.9.2
ios-sim : …Run Code Online (Sandbox Code Playgroud) 我正在学习离子,我想在左、中和右对齐我的 3 个按钮。即左侧的第一个按钮,中间的第二个和右侧的第三个。
但我不知道该怎么做?
这是我的代码。
<div>
<button ion-button icon-left>
<ion-icon name="home"></ion-icon>
Left Icon
</button>
<button ion-button icon-only>
<ion-icon name="home"></ion-icon>
</button>
<button ion-button icon-right>
Right Icon
<ion-icon name="home"></ion-icon>
</button>
</div>
Run Code Online (Sandbox Code Playgroud)
任何人都可以指导我吗?因为我是初学者和学习离子。