* [html5] bugfix: appear only trigger once when there's no disappear handler 
bound.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ec5b7914
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ec5b7914
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ec5b7914

Branch: refs/heads/dev
Commit: ec5b79142d13d319d21ed8092f8a2f5857cb341f
Parents: b0741d8
Author: MrRaindrop <tekk...@gmail.com>
Authored: Tue Sep 5 18:11:46 2017 +0800
Committer: MrRaindrop <tekk...@gmail.com>
Committed: Tue Sep 5 18:11:46 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/component.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ec5b7914/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js 
b/html5/render/vue/utils/component.js
index f587b26..eb8ded7 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -202,7 +202,12 @@ export function detectAppear (context, visible, dir = 
null) {
   const el = context && context.$el
   if (!el) { return }
   const handlers = getEventHandlers(context)
-  if (!handlers[visible ? 'appear' : 'disappear']) { return }
+  /**
+   * No matter it's binding appear/disappear or both of them. Always
+   * should test it's visibility and change the context._visible.
+   * If neithor of them was bound, then just ignore it.
+   */
+  if (!handlers['appear'] && !handlers['disappear']) { return }
   /**
    * if the component hasn't appeared for once yet, then it shouldn't trigger
    * a disappear event at all.

Reply via email to