vue生产环境阻止鼠标右键
// 生产环境阻止鼠标右键
Vue.directive('preventright', {
bind: function(el, binding, vnode) {
if (process.env.NODE_ENV !== 'development') {
el.oncontextmenu = function() { return false }
}
}
})
app.vue
<template>
<div id="app" v-preventright @click="checkOperation">
<router-view />
<WorkFlowNotice />
</div>
</template>