document.oncontextmenu = function () {
new Vue({
data:function(){
this.$notify({
title: "嗯?没有右键菜单",
message: "复制请用键盘快捷键[Ctrl+C]",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"warning"
});
return{visible:false}
}
})
return false;
}
document.onkeydown = function(event) {
if (event.ctrlKey && event.keyCode == 83) { // Ctrl + S
event.preventDefault();
new Vue({
data: function() {
this.$notify({
title: "哎!你瞧瞧你",
message: "网页得换方法保存哦~",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "error"
});
return {
visible: false
}
}
})
return false;
}
if (event.ctrlKey && event.keyCode == 85) { // Ctrl + U
event.preventDefault();
new Vue({
data: function() {
this.$notify({
title: "嘿!Brother",
message: "老弟,源码得换方式获取哦~",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "error"
});
return {
visible: false
}
}
})
return false;
}
if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { //
Ctrl + Shift + I
event.preventDefault();
new Vue({
data:function(){
this.$notify({
title:"呐!这个也不行",
message:"还是按点别的吧!",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"error"
});
return{visible:false}
}
})
return false;
}
if (event.keyCode == 123) { // F12
event.preventDefault();
new Vue({
data:function(){
this.$notify({
title:"呃!别瞎按",
message:"你按这个想干嘛!再按就找不到我咯",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"error"
});
return{visible:false}
}
})
return false;
}
};