framework7页面初始化事件未触发

编程入门 行业动态 更新时间:2024-10-27 13:22:07
本文介绍了framework7页面初始化事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用framework7,但无法触发页面初始化事件.我使用的代码非常简单,我非常仔细地遵循了文档.无论我做什么,它都不会触发(什么都没有记录到控制台,也没有错误).

I am trying to use framework7 and cannot get the page init event to fire. The code I am using is very simple, and I have followed the documentation very carefully. No matter what I do, it never fires (nothing is logged to the console, and no errors).

我创建了一个在此显示问题的笔.

我也用回调myApp.onPageInit尝试了它.娜达.

I also tried it with the callback myApp.onPageInit. Nada.

非常感谢任何帮助.

JS代码

var myApp = new Framework7({}); var $ = Dom7; var mainView = myApp.addView('.view-main', { dynamicNavbar: true }); $(document).on('page:init', function (e) { alert("processing page init"); });

HTML

<div class="views"> <div class="view view-main navbar-through toolbar-through"> <div class="navbar"> <div class="navbar-inner"> <div class="center">Framework7</div> </div> </div> <div class="toolbar"> <div class="toolbar-inner"> <a href="#" class="link">Left</a> <a href="#" class="link">Right</a> </div> </div> <div class="pages"> <div class="page" data-page="home"> <div class="page-content"> <div class="content-block"> <p>Hi there!</p> </div> </div> </div> </div> </div> </div>

推荐答案

可以通过手动初始化应用(有时,在第一个加载的文件中包含内容时不会触发事件)

It may be solved by init app manually (sometimes event is not fired when content is in the first file loaded)

或者尝试触发您的主页回调(链接的第三点)

Or try to trigger your home page callback (third point of link)

更多推荐

framework7页面初始化事件未触发

本文发布于:2023-11-04 01:27:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1556572.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   事件   页面

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!