Authored by ccbikai

增加全局事件

... ... @@ -18,6 +18,7 @@ const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const interceptClick = require('common/intercept-click');
const bus = require('common/vue-bus');
// 隐藏 App 默认显示的 loading
Vue.mixin({
... ... @@ -34,6 +35,7 @@ $(() => {
if ($body.hasClass('no-local-js')) {
yoho.showLoading(false); // 隐藏 App 默认显示的 loading
}
$body.on('click', 'a[href]', function() {
// 拦截跳转
if (!$(this).hasClass('no-intercept')) {
... ... @@ -41,4 +43,9 @@ $(() => {
return false;
}
});
yoho.addNativeMethod('triggerEvent', (eventName) => {
alert(eventName);
bus.$emit(eventName);
});
});
... ...