framework7下为何navbar放在视图里页面前的话在ios显示不出导航栏,在android下显示不出二级导航栏?
问题如题
<body>
<!-- App root element -->
<div id="app">
<!-- Statusbar overlay -->
<div class="statusbar">123123</div>
<!-- Your main view, should have "view-main" class -->
<div class="view view-main">
<!-- Top Navbar -->
<div class="navbar">
<div class="navbar-inner">
<div class="title">导航栏</div>
<div class="subnavbar">
<div class="subnavbar-inner">
<div class="segmented segmented-raised">
<button class="button" ontouchend="fn_TBD();">二级导航栏</button>
<button class="button" ontouchend="fn_TBD();">demo</button>
</div>
</div>
</div>
</div>
</div>
<!-- Initial Page, "data-name" contains page name -->
<div data-name="home" class="page page-with-subnavbar">
<!-- Scrollable page content -->
<div class="page-content">
</div>
</div>
<div class="toolbar tabbar toolbar-bottom-md no-shadow ">
<div class="toolbar-inner">
<a href="/invitationList/" class="tab-link">demo1</a>
<a href="/lectureList/" class="tab-link">demo2</a>
</div>
</div>
</div>
</div>
<!-- Path to Framework7 Library JS-->
<script type="text/javascript" src="./dist/js/framework7.min.js"></script>
<!-- Path to your app js-->
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="./js/my-app.js"></script>
</body>
my-app.js里面内容
var app = new Framework7({
// App root element
root: '#app',
// App Name
name: 'my app',
// App id
id: 'com.myapp.test',
// Enable swipe panel
panel: {
swipe: 'left',
},
// Add default routes
routes: [{
path: '/about/',
url: 'about.html',
},
{
path: '/popup-content/',
popup: {
content: '<div class="popup"><div class="view"><div class="page">演习演习</div></div></div>'
},
},
{
path: '/chat/',
url: './pages/chat.html',
},
],
// ... other parameters
on: {
init: function() {
console.log('App initialized');
},
pageInit: function() {
console.log('Page initialized');
},
},
theme: 'ios',
methods: {
alert: function() {
app.dialog.alert('Hello World');
}
},
clicks: {
externalLinks: '.external',
},
dialog: {
title: 'Message from haihao',
},
navbar: {
hideOnPageScroll: true,
iosCenterTitle: true,
},
toolbar: {
hideOnPageScroll: false,
},
toast: {
closeTimeout: 3000,
closeButton: true,
},
});
var mainView = app.views.create('.view-main', {
name: 'Fw7',
on: {
pageInit: function() {
console.log(this.router);
}
},
});
app.theme分别切换为'ios'、'auto'的时候,前者显示不出导航栏,后者显示不出二级导航栏。
以上是在Hbuilder里面进行测试的。
请问有前辈知道是怎么回事么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论