import './Activity' const TEMPLATE =`
`; Vue.component('attract-activities', { template: TEMPLATE, props: { objectId: String, outdated: { type: Boolean, default: true } }, data() { return { activities: [], } }, watch: { objectId() { this.fetchActivities(); }, outdated(isOutDated) { if(isOutDated) { this.fetchActivities(); } } }, created() { this.fetchActivities() }, methods: { fetchActivities() { pillar.api.thenGetNodeActivities(this.objectId) .then(it => { this.activities = it['_items']; this.$emit('activities-updated'); }); } }, });