Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit b0d1b5a

Browse files
committed
Also add a prop for if the tab is visible
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent cef0612 commit b0d1b5a

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

src/components/CollectionList.vue

+24-8
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ export default {
111111
name: {
112112
type: String,
113113
default: ''
114+
},
115+
isActive: {
116+
type: Boolean,
117+
default: true
114118
}
115119
},
116120
data() {
@@ -173,16 +177,28 @@ export default {
173177

174178
watch: {
175179
type() {
176-
actions.fetchCollectionsByResource({
177-
resourceType: this.type,
178-
resourceId: this.id
179-
})
180+
if (this.isActive) {
181+
actions.fetchCollectionsByResource({
182+
resourceType: this.type,
183+
resourceId: this.id
184+
})
185+
}
180186
},
181187
id() {
182-
actions.fetchCollectionsByResource({
183-
resourceType: this.type,
184-
resourceId: this.id
185-
})
188+
if (this.isActive) {
189+
actions.fetchCollectionsByResource({
190+
resourceType: this.type,
191+
resourceId: this.id
192+
})
193+
}
194+
},
195+
isActive(isActive) {
196+
if (isActive) {
197+
actions.fetchCollectionsByResource({
198+
resourceType: this.type,
199+
resourceId: this.id
200+
})
201+
}
186202
}
187203
},
188204

0 commit comments

Comments
 (0)