一、全局自定义返回按钮javascript
在app.scss文件中,添加以下代码css
imports: [ IonicModule.forRoot(MyApp,{ backButtonText: '', backButtonIcon: 'ios-arrow-back', iconMode: 'md' }) ]
二、ios中,导航栏、状态栏重叠java
IonicModule.forRoot(MyApp, { platforms: { ios: { statusbarPadding: true } }, backButtonIcon:'ios-arrow-back', backButtonText:'', mode: 'ios', scrollAssist: false }, deepLinkConfig), IonicStorageModule.forRoot() ],
设置“statusbarPadding: true”解决。ios
三、路由配置npm
const deepLinkConfig: DeepLinkConfig = { links:[ { component: MyApp, name: 'MyApp', segment: 'myApp' }, { component: ContactPage, name: 'ContactPage', segment: 'contactPage' }, { component: AboutPage, name: 'AboutPage', segment: 'aboutPage/:name/:age', defaultHistory: [ ContactPage ] } ] }
component:组件app
segment:路由路径ionic
defaultHistory:上一个页面ui
四、在pc端部署时压缩www方法:spa
从终端进入Ionic工程根目录,执行如下命令code
npm run ionic:build --prod
五、集成js库注意事项:
一、使用“var dsBridge=require("*****")”前,须要声明“declare function require(path)”方法