Authored by ccbikai

侧边栏也拦截跳转

... ... @@ -11,6 +11,7 @@ module.exports = (url) => {
url: url
});
} else {
location.href = url;
// location.href = url;
}
};
... ...
... ... @@ -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>
... ...
... ... @@ -100,8 +100,9 @@
this.contentCode = contentCode[page][channel];
});
},
attached() {
ready() {
$('.resources').on('click', 'a', function() {
// 拦截跳转
interceptClick($(this).attr('href'));
return false;
});
... ...