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
227e69fed1896d34aa18611abd45a521e3dcaec9
1 parent
00d3be0f
侧边栏也拦截跳转
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
public/js/common/intercept-click.js
public/vue/channel/sidebar.vue
public/vue/component/resources/index.vue
public/js/common/intercept-click.js
View file @
227e69f
...
...
@@ -11,6 +11,7 @@ module.exports = (url) => {
url
:
url
});
}
else
{
location
.
href
=
url
;
// location.href = url;
}
};
...
...
public/vue/channel/sidebar.vue
View file @
227e69f
...
...
@@ -14,8 +14,7 @@
</template>
<script>
// const tab = require('channel/tab.vue');
// const resources = require('component/resources/index.vue');
const interceptClick = require('common/intercept-click');
module.exports = {
data() {
...
...
@@ -23,14 +22,19 @@
list: []
};
},
components: {
},
created() {
$.ajax({
url: '/sidebar'
}).then((res) => {
this.list = res.data;
});
},
ready() {
$('.sidebar').on('click', 'a', function() {
// 拦截跳转
interceptClick($(this).attr('href'));
return false;
});
}
};
</script>
...
...
public/vue/component/resources/index.vue
View file @
227e69f
...
...
@@ -100,8 +100,9 @@
this.contentCode = contentCode[page][channel];
});
},
attached
() {
ready
() {
$('.resources').on('click', 'a', function() {
// 拦截跳转
interceptClick($(this).attr('href'));
return false;
});
...
...
Please
register
or
login
to post a comment