2021-07-29 16:19:07 +00:00
|
|
|
import Vue from 'vue';
|
2018-08-07 21:47:50 +00:00
|
|
|
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;
|
2020-07-31 19:11:03 +00:00
|
|
|
|
2018-08-07 21:47:50 +00:00
|
|
|
return {
|
|
|
|
show: function (container) {
|
|
|
|
vm = new Vue(HelloWorld);
|
|
|
|
container.appendChild(vm.$mount().$el);
|
|
|
|
},
|
|
|
|
destroy: function (container) {
|
2023-07-19 18:22:23 +00:00
|
|
|
//vm.$destroy();
|
2018-08-07 21:47:50 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
2020-07-31 19:11:03 +00:00
|
|
|
};
|
2018-08-07 21:47:50 +00:00
|
|
|
}
|
|
|
|
|
2020-07-31 19:11:03 +00:00
|
|
|
export default SimpleVuePlugin;
|