File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,24 @@ mutable struct DashApp
40
40
41
41
end
42
42
43
+ const VecChildTypes = Union{NTuple{N, DashBase. Component} where {N}, Vector{<: DashBase.Component }}
44
+ function Base. getindex (app:: Dash.DashApp , id:: AbstractString )
45
+ app. layout[id]
46
+ end
47
+ function Base. getindex (component:: DashBase.Component , id:: AbstractString )
48
+ component. id == id && return component
49
+ hasproperty (component, :children ) || return nothing
50
+ cc = component. children
51
+ cc isa Union{VecChildTypes, DashBase. Component} ? cc[id] : nothing
52
+ end
53
+ function Base. getindex (children:: VecChildTypes , id:: AbstractString )
54
+ for element in children
55
+ element. id == id && return element
56
+ el = element[id]
57
+ el != = nothing && return el
58
+ end
59
+ end
60
+
43
61
# only name, index_string and layout are available to set
44
62
function Base. setproperty! (app:: DashApp , property:: Symbol , value)
45
63
property == :index_string && return set_index_string! (app, value)
You can’t perform that action at this time.
0 commit comments