You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/03/31 07:29:03 UTC

[28/50] [abbrv] incubator-weex git commit: * [html5] support @appear.native for compatiblitiy with weex native.

* [html5] support @appear.native for compatiblitiy with weex native.


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

Branch: refs/heads/0.12-dev
Commit: dca2838b3c0b3d3da2000169a8433e197ef38eb7
Parents: 92d8af9
Author: MrRaindrop <te...@gmail.com>
Authored: Mon Mar 27 22:57:34 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon Mar 27 22:57:34 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/utils/component.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/dca2838b/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index f1ffc50..eee9644 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -1,5 +1,5 @@
-import { throttle } from './func'
-import { createEvent } from '../utils'
+import { throttle, extend } from './func'
+import { createEvent } from './event'
 
 export function getParentScroller (vnode) {
   if (!vnode) return null
@@ -55,8 +55,9 @@ export function watchAppear (context) {
   if (!context) return null
 
   context.$nextTick(() => {
-    if (context.$options && context.$options._parentListeners) {
-      const on = context.$options._parentListeners
+    if ((context.$options && context.$options._parentListeners)
+      || (context.$vnode && context.$vnode.data && context.$vnode.data.on)) {
+      const on = extend({}, context.$options._parentListeners, context.$vnode.data.on)
       if (on.appear || on.disappear) {
         const scroller = getParentScroller(context)
         let isWindow = false