openmct/example/simpleVuePlugin/plugin.js
Andrew Henry c51fd21847
Experimental unit tests for the Telemetry Table component (#2533)
* Initial commit of telemetry table spec
* Added example directory to linter paths. Fixed outstanding linting issues
2019-11-27 16:04:52 -08:00

36 lines
1.0 KiB
JavaScript

import Vue from 'Vue';
import HelloWorld from './HelloWorld.vue';
function SimpleVuePlugin() {
return function install(openmct) {
openmct.types.addType('hello-world', {
name: 'Hello World',
description: 'An introduction object',
creatable: true
});
openmct.objectViews.addProvider({
name: "demo-provider",
key: "hello-world",
cssClass: "icon-packet",
canView: function (d) {
return d.type === 'hello-world';
},
view: function (domainObject) {
var vm;
return {
show: function (container) {
vm = new Vue(HelloWorld);
container.appendChild(vm.$mount().$el);
},
destroy: function (container) {
vm.$destroy();
}
};
}
});
}
}
export default SimpleVuePlugin