BookStack/resources/assets/js/vues/vues.js

24 lines
671 B
JavaScript
Raw Normal View History

const Vue = require("vue");
function exists(id) {
return document.getElementById(id) !== null;
}
let vueMapping = {
'search-system': require('./search'),
'entity-dashboard': require('./entity-dashboard'),
'code-editor': require('./code-editor'),
'image-manager': require('./image-manager'),
2017-08-11 03:11:25 +08:00
'tag-manager': require('./tag-manager'),
2017-08-19 20:55:56 +08:00
'attachment-manager': require('./attachment-manager'),
};
window.vues = {};
2017-08-19 20:55:56 +08:00
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);
}