Extjs中app.js文件中的onUpdated函数什么时候执行

本文详细介绍了Extjs应用中app.js的onUpdated函数的执行时机。官方解释表明,当HTML5 manifest文件变化或者app.json中列出的JavaScript或CSS资产改变时,该函数会被触发。在实际测试中,修改app.json内如index.html等文件并重新构建应用后,系统再次打开时,onUpdated函数将执行。
摘要由CSDN通过智能技术生成

官方原版答案是:
As a short explanation: ‘onUpdated’ is triggered after either, or both of the following cases happen:

  • Your application’s HTML 5 manifest file (cache.manifest) changes. Read more on HTML 5 app cache if you’re new to this feature. Since cache.manifest is generated automatically, it contains the checksum values of all managed assets. As you modify the content of index.html file or any other file listed in the ‘appCache’ config inside app.json, their checksum values change -> the content of cache.manifest changes.

  • You have changes in any of your JavaScript or CSS assets listed in the “js” and “css” config inside app.json. Similarly to cache.manifest, when you build your application for production, a production version of app.json is generated automatically. This file contains checksums for all assets. By comparing the latest checksum values with the ones locally stored inside Local Storage, the app knows exactly what file has changed, and pull down the delta for that item, then patch its local copy to make it identical to the latest one.

经过亲自测试后发现:
如果更改了app.json中列出的文件,例如index.html,然后重新sencha app build
当再次打开系统时,该函数就会被执行。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值