File tree Expand file tree Collapse file tree 5 files changed +41
-19
lines changed
cli-ui-addon-webpack/src/components Expand file tree Collapse file tree 5 files changed +41
-19
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ import { size } from '../filters'
118
118
import DonutModule from ' ./DonutModule.vue'
119
119
120
120
export default {
121
+ clientState: true ,
122
+
121
123
mixins: [
122
124
Dashboard
123
125
],
Original file line number Diff line number Diff line change 24
24
</ApolloQuery >
25
25
</template >
26
26
27
+ <script >
28
+ export default {
29
+ clientState: true
30
+ }
31
+ </script >
32
+
27
33
<style lang="stylus" scoped>
28
34
@import "~@/style/imports"
29
35
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ import DARK_MODE_SET from '../graphql/darkModeSet.gql'
83
83
let lastRoute
84
84
85
85
export default {
86
+ clientState: true ,
87
+
86
88
data () {
87
89
return {
88
90
showLogs: false ,
Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ const darkTheme = {
73
73
}
74
74
75
75
export default {
76
+ clientState: true ,
77
+
76
78
props: {
77
79
cols: {
78
80
type: Number ,
@@ -136,21 +138,12 @@ export default {
136
138
137
139
content: ' setContent' ,
138
140
139
- theme: {
140
- handler (value ) {
141
- if (this .$_terminal ) {
142
- this .$_terminal ._setTheme (this .theme )
143
- }
144
- },
145
- immediate: true
146
- }
147
- },
148
-
149
- mounted () {
150
- this .initTerminal ()
151
-
152
- if (this .autoSize ) {
153
- this .$nextTick (this .fit )
141
+ darkMode (value , oldValue ) {
142
+ if (typeof oldValue === ' undefined' ) {
143
+ this .initTerminal ()
144
+ } else if (this .$_terminal ) {
145
+ this .$_terminal ._setTheme (this .theme )
146
+ }
154
147
}
155
148
},
156
149
@@ -171,6 +164,10 @@ export default {
171
164
172
165
term .on (' blur' , () => this .$emit (' blur' ))
173
166
term .on (' focus' , () => this .$emit (' focus' ))
167
+
168
+ if (this .autoSize ) {
169
+ this .$nextTick (this .fit )
170
+ }
174
171
},
175
172
176
173
setContent (value , ln = true ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,24 @@ import DARK_MODE from '../graphql/darkMode.gql'
3
3
4
4
// @vue /component
5
5
export default {
6
- apollo : {
7
- // In plugins, user `this.$root.connected` for example
8
- connected : CONNECTED ,
9
- darkMode : DARK_MODE
6
+ beforeCreate ( ) {
7
+ if ( this . $options . clientState ) {
8
+ const newData = {
9
+ connected : CONNECTED ,
10
+ darkMode : DARK_MODE
11
+ }
12
+ this . $options . apollo = {
13
+ ...this . $options . apollo ,
14
+ ...newData
15
+ }
16
+ // Proxy prop on `this`
17
+ for ( const key in newData ) {
18
+ Object . defineProperty ( this , key , {
19
+ get : ( ) => this . $data . $apolloData . data [ key ] ,
20
+ enumerable : true ,
21
+ configurable : true
22
+ } )
23
+ }
24
+ }
10
25
}
11
26
}
You can’t perform that action at this time.
0 commit comments