简体   繁体   English

使用ionic 3的平台之间没有差异

[英]No difference between the platforms using ionic 3

I wanted to try ionic 3, but I have some issues at the beginning. 我想尝试离子3,但开始时遇到一些问题。 When I start the application with the ionic lab or the ionic serve command, when the browser shows the platforms, the views are the same on every device (ios, android, windows) 当我使用ionic labionic serve命令启动应用程序时,当浏览器显示平台时,每个设备(ios,android,windows)上的视图都相同

Although if I set IonicModule.forRoot(MyApp) to IonicModule.forRoot(MyApp, {mode: 'ios'}) in the app.module.ts it changes to iOS view on all the devices, or if I set to IonicModule.forRoot(MyApp, {mode: 'md'}) it changes to Android on all the devices. 虽然如果我设置IonicModule.forRoot(MyApp)IonicModule.forRoot(MyApp, {mode: 'ios'})app.module.ts它改变到iOS视图上的所有设备,或者如果设置了到IonicModule.forRoot(MyApp, {mode: 'md'})它将在所有设备上更改为Android。 But when I start the application with the default code every device shows the same view, and I never could reach the devices to show their own views. 但是,当我使用默认代码启动应用程序时,每个设备都显示相同的视图,而我再也无法到达这些设备以显示自己的视图。

Here you can see the default operation 在这里您可以看到默认操作

And here when I sterted with IonicModule.forRoot(MyApp, {mode: 'ios'}) command 在这里,当我用IonicModule.forRoot(MyApp, {mode: 'ios'})命令

Are there any idea why doesn't work as in all the videos I saw on the internet? 有什么想法为什么不能像我在互联网上看到的所有视频一样起作用吗? Thank you for helping. 感谢您的帮助。

Without seeing the URL you are opening, here's my best guess: Try opening 没有看到您要打开的URL,这是我的最佳猜测:尝试打开

http://localhost:8100/ionic-lab HTTP://本地主机:8100 /离子实验室

rather than http://localhost:8200 . 而不是http:// localhost:8200 Worked for me in the same situation. 在相同的情况下为我工作。

Maybe there is an issue with your installation of ionic? 您安装的ionic也许有问题? Try uninstalling Ionic & Cordova, clearing the cache and updating NPM. 尝试卸载Ionic&Cordova,清除缓存并更新NPM。 Then reinstall everything. 然后重新安装所有内容。 Use the following commands: 使用以下命令:

npm uninstall ionic cordova

npm cache clean -f

npm install -g npm

npm install -g ionic cordova

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM