【发布时间】:2014-09-12 22:26:02
【问题描述】:
我正在构建的响应式应用上有一个标签栏:
<template name="tabNav">
<nav class="bar bar-tab">
<a class="tab-item" id="groups-nav" href="{{pathFor 'groupsList'}}">
<span class="icon icon-star-filled"></span>
<span class="tab-label">Groups</span>
</a>
<a class="tab-item active" id="games-nav" href="{{pathFor 'locationSet'}}">
<span class="icon icon-list"></span>
<span class="tab-label">Games</span>
</a>
<!-- more code -->
</template>
'groupsList' 的 pathFor 可在桌面设备上使用,但在移动设备上不可用。你可以在这里试试:pp-groups.meteor.com。
这只是一个原型,不使用任何真实数据。我所有的观点代码都可以在这里找到:https://github.com/stewartmccoy/pp-groups/tree/master/groups/client/views
这些是我定义的路线:
Router.map(function() {
this.route('layout', {
path: '/',
template: 'getLocation',
layoutTemplate: 'getLocation',
yieldTemplates: {
'tabNav': {to: 'footer'}
}
});
this.route('locationSet', {
path: '/locationSet',
template: 'locationSet',
layoutTemplate: 'locationSet'
});
this.route('groupsList', {
path: '/groupsList',
template: 'groupsList',
layoutTemplate: 'groupsList'
});
});
为什么 pathFor 不能在移动设备上运行? (它至少在 Xcode iOS 模拟器或 iPhone Mobile Safari 或 Chrome 上不起作用)。
【问题讨论】:
-
我们在谈论哪些移动浏览器?
-
@ChristianFritz 它在 Xcode iOS 模拟器或 iPhone Mobile Safari 或 Chrome 上不起作用。
标签: meteor iron-router