Authored by ccbikai

拦截跳转

/**
* 拦截跳转, 在这里给将要打开的页面设置一下 header 样式
* @return {[type]}
*/
const yoho = require('yoho');
module.exports = (url) => {
console.log(url);
if (yoho.isApp) {
yoho.goNewPage({
url: url
});
} else {
location.href = url;
}
};
... ...
... ... @@ -27,6 +27,7 @@
const $ = require('yoho-jquery');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const interceptClick = require('common/intercept-click');
const contentCode = require('content-code');
const focus = require('./focus.vue');
... ... @@ -98,6 +99,12 @@
bus.$on('channel.change', (page, channel) => {
this.contentCode = contentCode[page][channel];
});
},
attached() {
$('.resources').on('click', 'a', function() {
interceptClick($(this).attr('href'));
return false;
});
}
};
</script>
... ...