2018-08-07 21:47:50 +00:00
|
|
|
import Vue from 'Vue';
|
|
|
|
import HelloWorld from './HelloWorld.vue';
|
|
|
|
|
2019-11-28 00:04:52 +00:00
|
|
|
function SimpleVuePlugin() {
|
2018-08-07 21:47:50 +00:00
|
|
|
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
|