当在tabbar中使用时,Onsen UI拉钩会抛出错误

时间:2022-08-24 13:12:25

I am using the pull hook component on a page that contains a ons-list element. This page is one of three (also list pages) that I use the tabbar component to navigate between. I only use the pull hook on the one page.

我正在使用一个包含ons列表元素的页面上的pull钩子组件。这个页面是我使用tabbar组件在其中导航的三个(也是列表页面)之一。我只用一页纸上的拉钩。

When switching pages (via the tabbar component) an error gets thrown:

当切换页面(通过tabbar组件)时,会抛出一个错误:

"Error: undefined is not a function (evaluating 'element.off(:scroll",this._bindedOnScroll)')_destroyEventListeners@www/components/loader.js:1440:53691 _destroy@www/components/loader.js:1440:53771"

“错误:未定义的不是一个函数(评估'element.off(:scroll,this._bindedOnScroll)')_destroyEventListeners@www/component /loader。js:1440:53691 _destroy@www /组件/ loader.js:1440:53771”

Can the pull hook component be used with the tabbar?

拖钩组件可以与选项卡一起使用吗?

1 个解决方案

#1


2  

The error happens when the pull hook is unloaded. It's an issue in the destructor.

当卸载拉钩时发生错误。这在析构函数中是一个问题。

If you make the tab "persistent" you won't experience the issue since it won't unload the pull hook:

如果你将标签设置为“持久性”,你将不会遇到这个问题,因为它不会卸载拉钩:

<ons-tab persistent>

The error has been fixed in the latest beta version of Onsen UI (1.3.0-beta). You can install it with "bower install onsenui#1.3.0-beta" or you can wait for the 1.3.0 release which is due in a couple of days.

这个错误已经在最新的Onsen UI测试版(1.3.0-beta)中修正。您可以使用“bower install onsenui#1.3.0-beta”安装它,也可以等待几天后即将发布的1.3.0版本。

#1


2  

The error happens when the pull hook is unloaded. It's an issue in the destructor.

当卸载拉钩时发生错误。这在析构函数中是一个问题。

If you make the tab "persistent" you won't experience the issue since it won't unload the pull hook:

如果你将标签设置为“持久性”,你将不会遇到这个问题,因为它不会卸载拉钩:

<ons-tab persistent>

The error has been fixed in the latest beta version of Onsen UI (1.3.0-beta). You can install it with "bower install onsenui#1.3.0-beta" or you can wait for the 1.3.0 release which is due in a couple of days.

这个错误已经在最新的Onsen UI测试版(1.3.0-beta)中修正。您可以使用“bower install onsenui#1.3.0-beta”安装它,也可以等待几天后即将发布的1.3.0版本。