File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 77
77
</VueGroup >
78
78
</div >
79
79
80
- <div v-if =" displayPriority >= 2" class =" content" >
80
+ <div v-if =" !defer(3)" class =" content placeholder-content" >
81
+ <div class =" view card" />
82
+ </div >
83
+
84
+ <div v-else class =" content" >
81
85
<TerminalView
82
86
ref =" terminal"
83
87
:class =" {
133
137
134
138
<script >
135
139
import Prompts from ' @/mixins/Prompts'
136
- import DisplayPriority from ' @/mixins/DisplayPriority '
140
+ import Defer from ' @/mixins/Defer '
137
141
138
142
import TASK from ' @/graphql/task/task.gql'
139
143
import TASK_LOGS from ' @/graphql/task/taskLogs.gql'
@@ -159,7 +163,7 @@ export default {
159
163
field: ' task' ,
160
164
query: TASK
161
165
}),
162
- DisplayPriority ( 2 )
166
+ Defer ( )
163
167
],
164
168
165
169
metaInfo () {
@@ -199,7 +203,7 @@ export default {
199
203
}
200
204
},
201
205
skip () {
202
- return this .displayPriority < 1
206
+ return ! this .defer ( 2 )
203
207
}
204
208
},
205
209
@@ -222,7 +226,7 @@ export default {
222
226
}
223
227
},
224
228
skip () {
225
- return this .displayPriority < 2
229
+ return ! this .defer ( 3 )
226
230
}
227
231
},
228
232
@@ -242,7 +246,7 @@ export default {
242
246
}
243
247
},
244
248
skip () {
245
- return this .displayPriority < 2
249
+ return ! this .defer ( 3 )
246
250
}
247
251
}
248
252
}
@@ -259,6 +263,7 @@ export default {
259
263
return id
260
264
}
261
265
}
266
+ return null
262
267
}
263
268
},
264
269
@@ -370,6 +375,7 @@ export default {
370
375
margin 0 $padding-item $padding-item
371
376
position relative
372
377
378
+ .placeholder-content .view ,
373
379
.terminal-view
374
380
position absolute
375
381
top 0
Original file line number Diff line number Diff line change 1
- export default function ( count = 1 ) {
1
+ export default function ( count = 10 ) {
2
2
// @vue /component
3
3
return {
4
4
data ( ) {
@@ -13,6 +13,7 @@ export default function (count = 1) {
13
13
14
14
methods : {
15
15
runDisplayPriority ( ) {
16
+ this . displayPriority = 0
16
17
const step = ( ) => {
17
18
requestAnimationFrame ( ( ) => {
18
19
this . displayPriority ++
@@ -22,6 +23,10 @@ export default function (count = 1) {
22
23
} )
23
24
}
24
25
step ( )
26
+ } ,
27
+
28
+ defer ( priority ) {
29
+ return this . displayPriority >= priority
25
30
}
26
31
}
27
32
}
You can’t perform that action at this time.
0 commit comments