mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 23:12:23 +00:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
|
import Vue from 'Vue';
|
||
|
import HelloWorld from './HelloWorld.vue';
|
||
|
|
||
|
function SimpleVuePlugin () {
|
||
|
return function install(openmct) {
|
||
|
var views = (openmct.mainViews || openmct.objectViews);
|
||
|
|
||
|
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
|