@@ -26,7 +26,7 @@ export default {
26
26
return widget . component
27
27
} ,
28
28
config ( ) {
29
- if ( ! this . context || ! this . context . component ) return null
29
+ if ( ! this . context ? .component ) return null
30
30
let evalConfig = { }
31
31
// Fallback to modelConfig for oh- components to allow configuring them in modals
32
32
const sourceConfig = this . context . component . config || ( this . componentType . startsWith ( 'oh-' ) ? this . context . modalConfig : { } )
@@ -40,8 +40,8 @@ export default {
40
40
return evalConfig
41
41
} ,
42
42
props ( ) {
43
- if ( ! this . context || ! this . context . component ) return { }
44
- if ( this . context . component . props && this . context . component . props . parameters ) {
43
+ if ( ! this . context ? .component ) return { }
44
+ if ( this . context . component . props ? .parameters ) {
45
45
let defaultValues = { }
46
46
this . context . component . props . parameters . forEach ( ( p ) => {
47
47
if ( p . default !== undefined ) {
@@ -63,14 +63,15 @@ export default {
63
63
const user = this . $store . getters . user
64
64
if ( ! user ) return false
65
65
if ( user . roles && user . roles . some ( r => visibleTo . indexOf ( 'role:' + r ) >= 0 ) ) return true
66
- if ( visibleTo . indexOf ( 'user:' + user . name ) >= 0 ) return true
67
- return false
66
+ return visibleTo . indexOf ( 'user:' + user . name ) >= 0
68
67
}
69
68
return true
70
69
}
71
70
} ,
72
71
mounted ( ) {
73
- if ( this . context && this . context . component && this . context . component . config && this . context . component . config . stylesheet ) {
72
+ if ( this . context ?. component ?. config ?. stylesheet ) {
73
+ if ( ! this . $el . classList ) return // widget is not rendered yet, skip scoped styling
74
+
74
75
this . cssUid = 'scoped-' + this . $f7 . utils . id ( )
75
76
76
77
this . $el . classList . add ( this . cssUid )
0 commit comments