File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 41
41
<CatalogTableList
42
42
v-else
43
43
:products =" catalogItems"
44
+ :loading =" loading"
44
45
/>
45
46
</div >
46
47
</div >
Original file line number Diff line number Diff line change 6
6
has-side-border
7
7
:headers =" tableHeaders"
8
8
is-small
9
+ :is-loading =" loading"
9
10
is-clickable
10
11
disable-pagination
11
12
@row:click =" handleRowClick"
@@ -55,6 +56,10 @@ export default defineComponent({
55
56
products: {
56
57
type: Array as PropType <CatalogItemModel []>,
57
58
default : () => []
59
+ },
60
+ loading: {
61
+ type: Boolean ,
62
+ default: false
58
63
}
59
64
},
60
65
setup (props ) {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export default defineComponent({
71
71
const searchString = ref (' ' )
72
72
const catalogItems = ref <CatalogItemModel []>([])
73
73
const totalCount = ref <number >(undefined )
74
- const loading = ref <boolean >(null )
74
+ const loading = ref <boolean >(true )
75
75
const searchTriggered = ref <boolean >(false )
76
76
const catalogView = ref <string >(undefined )
77
77
const catalogPageNumber = ref (1 )
@@ -149,14 +149,12 @@ export default defineComponent({
149
149
console .error (' failed to find Service Packages' , e )
150
150
}
151
151
} finally {
152
- loading .value = null
152
+ loading .value = false
153
153
}
154
154
}
155
155
156
156
const catalogViewChanged = (viewType : ' grid' | ' table' ) => {
157
- catalogItems .value = []
158
157
catalogView .value = viewType
159
- fetchProducts ()
160
158
}
161
159
162
160
const catalogPageChanged = (pageNumber : number ) => {
@@ -167,7 +165,10 @@ export default defineComponent({
167
165
}
168
166
169
167
onBeforeMount (async () => {
170
- await loadAppearance ()
168
+ await Promise .all ([
169
+ loadAppearance (),
170
+ fetchProducts ()
171
+ ])
171
172
})
172
173
173
174
return {
You can’t perform that action at this time.
0 commit comments