Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[core] fix appear event on root node (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he authored and YorkShen committed Jan 10, 2019
1 parent 87c7291 commit 6c77249
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion weex_core/Source/core/data_render/vnode/vcomponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6c77249

Please sign in to comment.