I'm working on a SharePoint Framework web part and using Vue.js.
Given this snippet:
export default class MyWorkspaceTestWebPart extends BaseClientSideWebPart<IMyWorkspaceTestWebPartProps> {
public uol_app;
public render(): void {
this.domElement.innerHTML = "some markup"
this.uol_app = new Vue({
el: `#vueapp-${this.context.instanceId}`,
data: {
announcements: [],
numOfAnnouncements: 4
},
computed: {
announcementsTrimmed: function() {
return this.uol_app.announcements.splice(0, this.uol_app.numOfAnnouncements)
}
}
})
}
}
On that last return statement, how can I get to the announcements and numOfAnnouncements Vue data properties?
I have tried:
return this.uol_app.announcements.splice(0, this.uol_app.numOfAnnouncements)
return this.uol_app.data.announcements.splice(0, this.uol_app.data.numOfAnnouncements)
return this.data.announcements.splice(0, this.data.numOfAnnouncements)
return this.announcements.splice(0, this.numOfAnnouncements)
return uol_app.announcements.splice(0, this.numOfAnnouncements)
thisreferencing?