BookStack/resources/js/vues/vues.js
Dan Brown 573c4e26d5
Finished moving tag-manager from a vue to a component
Now tags load with the page, not via AJAX.
2020-06-29 22:11:03 +01:00

32 lines
695 B
JavaScript

import Vue from "vue";
function exists(id) {
return document.getElementById(id) !== null;
}
import imageManager from "./image-manager";
import attachmentManager from "./attachment-manager";
import pageEditor from "./page-editor";
let vueMapping = {
'image-manager': imageManager,
'attachment-manager': attachmentManager,
'page-editor': pageEditor,
};
window.vues = {};
function load() {
let ids = Object.keys(vueMapping);
for (let i = 0, len = ids.length; i < len; i++) {
if (!exists(ids[i])) continue;
let config = vueMapping[ids[i]];
config.el = '#' + ids[i];
window.vues[ids[i]] = new Vue(config);
}
}
export default load;