Yas*_* B. 7 angular-ui-router ionic-framework
我正在使用Ionic框架和IU路由器为您的第一个Web应用程序提供更好的导航.
这里有一个简单的架构,因此您可以轻松地了解结构:

我面临的问题是,当我在标签之间导航时,我无法保持状态.例如.当我进入下一个标签并单击下一个视图并按回车键,然后我导航到第一个按钮,当我回到第二个标签时,我看不到我离开的相同状态.
我无法解决这个问题.
这是一个DEMO:PLUNKER DEMO + CODE
这是我的州代码:
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('live.today', {
url: '/today',
views: {
today: {
templateUrl: 'today_live.html',
}
}
})
.state('live.yesterday', {
url: '/yesterday',
views: {
yesterday: {
templateUrl: 'yesterday_live.html'
}
}
})
.state('live.tomorrow', {
url: '/tomorrow',
views: {
tomorrow: {
templateUrl: 'tomorrow_live.html'
}
}
})
.state('match.composition', {
url: '/composition',
views: {
view: {
templateUrl: 'composition.html'
}
}
})
.state('match.resume', {
cache: false,
url: '/resume',
views: {
view: {
templateUrl: 'resume.html'
}
}
})
.state('live', {
url: '/live',
views: {
live_view: {
templateUrl: 'live.html'
}
}
})
.state('match', {
cache: false,
url: '/match_details',
views: {
live_view: {
templateUrl: 'match_details.html'
}
}
})
.state('news', {
cache: false,
url: '/news',
views: {
news: {
templateUrl: 'news.html'
}
}
})
$urlRouterProvider.otherwise('/live/today');
})
Run Code Online (Sandbox Code Playgroud)
最后我找到了一个解决方案,即将“添加<ion-content> </ion-content>到我有三个选项卡的文件(live.html)中。
您可以为具有相同复杂视图架构的人获取更新的演示
| 归档时间: |
|
| 查看次数: |
675 次 |
| 最近记录: |