Commit 25a47f09 authored by 任建锋's avatar 任建锋

--

parent 6f151c0c
...@@ -12,26 +12,46 @@ ...@@ -12,26 +12,46 @@
import Pane from '../../components/Pane'; import Pane from '../../components/Pane';
import DrawPanel from './components/drawPanel'; import DrawPanel from './components/drawPanel';
import DrawCanvasPanel from './components/drawCanvasPanel'; import DrawCanvasPanel from './components/drawCanvasPanel';
import events from "@/global-events.js"
export default { export default {
name: 'Playground', name: 'Playground',
components: { Pane, DrawPanel,DrawCanvasPanel}, components: { Pane, DrawPanel,DrawCanvasPanel},
data:{ props: {
zoom:0.5 zoom:0.5
}, },
methods: { data:{
},
methods: {
mouseWheel(e){
console.log(e)
if(e.deltaY>0){
this.zoom-=0.1
}else if(e.deltaY<0){
this.zoom+=0.1
}
console.log(this.zoom)
events.$emit('setPlaygroundZoom', {zoom:this.zoom});
}
}, },
computed: { computed: {
playgroundStyle(){ playgroundStyle(){
alert() //this.zoom=0.5;
let style={ let style={
zoom:`${this.zoom}` zoom:`${this.zoom}`
} }
console.log(1213,style)
return style return style
}, },
}, },
created(){ created(){
events.$emit('setPlaygroundZoom', {zoom:this.zoom}); //alert()
this.zoom=0.5;
document.body.addEventListener('mousewheel',(e)=>{
this.mouseWheel(e)
},false)
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment