vue 缩放

  • JS scale缩放
  • 节点缩放
handleHorizontalTurn(node) {
  let dom = this.$refs[node.id][0].$el;
  dom.style["-webkit-transform"] = `scale(${this.zoomScale})`;
  dom.style["-moz-transform"] = `scale(${this.zoomScale})`;
  dom.style["-ms-transform"] = `scale(${this.zoomScale})`;
  dom.style["-o-transform"] = `scale(${this.zoomScale})`;
  dom.style.transform = `scale(${this.zoomScale})`;
  node.width = parseInt(node.width) + 50 + ''
},
  • 整体缩放
baseZoom = 1
cutSize () {
    this.baseZoom += 0.1
    const zoom = this.baseZoom
    this.$refs.efContainer.style.transform = `scale(${zoom})`
    this.$refs.efContainer.style.WebkitTransform = `scale(${zoom})`
    this.$refs.efContainer.style.MozTransform = `scale(${zoom})`
    this.$refs.efContainer.style.MsTransform = `scale(${zoom})`
    this.$refs.efContainer.style.OTransform = `scale(${zoom})`
    
    jsPlumb.setZoom(zoom)
}
posted @ 2022-07-18 15:15  DL·Coder  阅读(263)  评论(0编辑  收藏  举报