methods:{
handler(e){
let big =this.$refs.big;let mask =this.$refs.mask;let left = e.offsetX - mask.offsetWidth /2;let top = e.offsetY - mask.offsetHeight /2;// 限制边界if(left <0){
left =0;}if(top <0){
top =0;}if(left > mask.offsetWidth){
left = mask.offsetWidth;}if(top > mask.offsetHeight){
top = mask.offsetHeight;}// 注意这里必须要加单位
mask.style.left = left +"px";
mask.style.top = top +"px";// 这个是展示框固定,图片移动所以要是负的
big.style.left =-2* left +"px";
big.style.top =-2* top +"px";},},