vimo-dt
Version:
A Vue2.x UI Project For Mobile & HyBrid
45 lines (35 loc) • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = install;
var _config = require('../config/config');
var _history = require('../history/history');
var _platform = require('../platform/platform');
var _package = require('../../package.json');
var addLogo = function addLogo(vimoVer, vueVer) {
var vimoLogo = {
info: 'Powered by Vimo@' + vimoVer + ' and based on Vue@' + vueVer + ' \n源代码请访问GitHub https://github.com/vm-component/vimo'
};
window.console && console.info && console.info(vimoLogo.info);
};
function install(Vue, options) {
var platform = (0, _platform.setupPlatform)(options.pltConf);
var config = (0, _config.setupConfig)(options.custConf, platform);
var history = (0, _history.setupHistory)(options.router, config, platform);
window.VM = {
platform: platform,
config: config,
history: history,
router: options.router || {},
version: _package.version,
vm: Vue
};
Vue.prototype.$config = config;
Vue.prototype.$platform = platform;
Vue.prototype.$history = history;
addLogo(_package.version, Vue.version);
var ev = document.createEvent('HTMLEvents');
ev.initEvent('VimoReady', false, false);
document.dispatchEvent(ev);
}