forked from tsai/budibase
7 changed files with 21 additions and 11 deletions
@ -0,0 +1,11 @@ |
|||||
|
export const setContext = treeNode => (key, value) => |
||||
|
(treeNode.context[key] = value) |
||||
|
|
||||
|
export const getContext = treeNode => key => { |
||||
|
if (treeNode.context && treeNode.context[key] !== undefined) |
||||
|
return treeNode.context[key] |
||||
|
|
||||
|
if (!treeNode.context.$parent) return |
||||
|
|
||||
|
return getContext(treeNode.parentNode)(key) |
||||
|
} |
||||
Loading…
Reference in new issue