There was an error: {{status.errorMessage}}
Example
Programs
Data
Functions
Program Areas
JavaScript:
new CMSStartD1Connector({
el: document.getElementById("destiny-output"),
config: CMSConfigObject.destinyOne,
setup: ({vue, status, functions, programAreas}) => {
/*
vue refs must be accessed with .value
status: object containing info on view state. Contains 'state' and 'errorMessage' properties
functions: object containing various functions
programAreas: vue ref array containing program area and stream information
Example of access:
programAreas.value[0].name
*/
// Vue utilities are properties of vue (vue.ref, vue.reactive, etc)
// Available vue utilities: ref, reactive, computed, onMounted, onUnmounted, watch, watchEffect, nextTick, onUpdated
const exampleRef = vue.ref(null);
const exampleReactive = vue.reactive({
prop1: 'value 1',
prop2: 'value 2',
});
// programAreas is null until the data is loaded
console.log("programAreas: ", programAreas.value);
// Watch for the 'ready' state to know programAreas is loaded and the view is ready
vue.watch(status, () => {
if (status.state === 'ready') {
console.log("programAreas: ", programAreas.value);
// Override default page title
functions.setPageTitle('My Page');
}
});
// Return anything you want to be available in the template as an object
// (Note: template refs must be returned in order to function)
return {
exampleReactive,
};
},
});