You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/10 03:53:03 UTC

[GitHub] YorkShen closed pull request #2030: [core] fix appear event on root node

YorkShen closed pull request #2030: [core] fix appear event on root node
URL: https://github.com/apache/incubator-weex/pull/2030
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/weex_core/Source/core/data_render/vnode/vcomponent.h b/weex_core/Source/core/data_render/vnode/vcomponent.h
index f142b30189..704dd162e8 100644
--- a/weex_core/Source/core/data_render/vnode/vcomponent.h
+++ b/weex_core/Source/core/data_render/vnode/vcomponent.h
@@ -52,7 +52,10 @@ class VComponent : public VNode {
   void MoveTo(VComponent* new_component);
 
   inline const std::string render_object_ref() const override {
-    return "_component_" + std::to_string(id_);
+    if (root_vnode_.get()) {
+      return root_vnode_->render_object_ref();
+    }
+    return "";
   }
 
   inline int id() { return id_; }
diff --git a/weex_core/Source/core/data_render/vnode/vnode_render_context.h b/weex_core/Source/core/data_render/vnode/vnode_render_context.h
index 456b1b5020..aa299a636d 100644
--- a/weex_core/Source/core/data_render/vnode/vnode_render_context.h
+++ b/weex_core/Source/core/data_render/vnode/vnode_render_context.h
@@ -74,6 +74,9 @@ class VNodeRenderContext {
   }
 
   inline void AddVNode(const std::string& ref, VNode* node) {
+    if (node->IsVirtualComponent()) {
+      return;
+    }
     auto it = vnode_trees_.find(ref);
     if (it != vnode_trees_.end()) {
       vnode_trees_[ref] = node;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services