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

[core] fix appear event on root node #2030

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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