|
@@ -16,7 +16,7 @@ export default {
|
|
|
default: ()=>{}
|
|
|
},
|
|
|
limit: {
|
|
|
- type: Boolean,
|
|
|
+ type: Object,
|
|
|
default: ()=>{
|
|
|
return {disabled:false}
|
|
|
}
|
|
@@ -36,6 +36,7 @@ export default {
|
|
|
copyDisable(e){
|
|
|
// 变向的禁止复制
|
|
|
// console.log(e.target.value && e.target.value.indexOf('lucksheet'));
|
|
|
+ if(!this.limit.disabled) return
|
|
|
if(e.target.value && e.target.value.indexOf('lucksheet')){
|
|
|
luckysheet.enterEditMode();
|
|
|
// luckysheet.exitEditMode();
|
|
@@ -51,14 +52,10 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.init();
|
|
|
- if(this.limit.disabled){
|
|
|
- document.addEventListener('copy',this.copyDisable)
|
|
|
- }
|
|
|
+ document.addEventListener('copy',this.copyDisable)
|
|
|
},
|
|
|
beforeDestroy(){
|
|
|
- if(this.limit.disabled){
|
|
|
- document.removeEventListener('copy',this.copyDisable)
|
|
|
- }
|
|
|
+ document.removeEventListener('copy',this.copyDisable)
|
|
|
}
|
|
|
}
|
|
|
</script>
|