Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
bb96e00b7839c6fd0402e532f0a9a1f01c1c7228
1 parent
b7eed003
拦截跳转
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
public/js/common/intercept-click.js
public/vue/component/resources/index.vue
public/js/common/intercept-click.js
0 → 100644
View file @
bb96e00
/**
* 拦截跳转, 在这里给将要打开的页面设置一下 header 样式
* @return {[type]}
*/
const
yoho
=
require
(
'yoho'
);
module
.
exports
=
(
url
)
=>
{
console
.
log
(
url
);
if
(
yoho
.
isApp
)
{
yoho
.
goNewPage
({
url
:
url
});
}
else
{
location
.
href
=
url
;
}
};
...
...
public/vue/component/resources/index.vue
View file @
bb96e00
...
...
@@ -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>
...
...
Please
register
or
login
to post a comment