<NME> mpvue-cropper.vue
<BEF> <template>
<div>
  <canvas
      v-if="_canvasId"
      :canvasId="_canvasId"
      @touchstart="touchstart"
      @touchmove="touchmove"
      @touchend="touchend"
      disable-scroll
      :style="{ width: _width + 'px', height: _height + 'px', background: 'rgba(0, 0, 0, .8)' }">
  </canvas>
  <canvas
    v-if="_targetId"
    :canvas-id="_targetId"
    disable-scroll
    :style="{
      position: 'fixed',
      top: -_width * _pixelRatio + 'px',
      left: -_height * _pixelRatio + 'px',
      width: _width * _pixelRatio + 'px',
      height: _height * _pixelRatio + 'px'
    }">
  </canvas>
</div>
</template>

<script>
  import WeCropper from 'we-cropper'

  export default {
    name: 'mpvue-cropper',
    props: {
      option: {
        type: Object
      }
    },
    data () {
      return {
        _wecropper: null
      }
    },
    computed: {
      _canvasId () {
        return this.option.id
      },
      _targetId () {
        return this.option.targetId
      },
      _width () {
        return this.option.width
      },
      _height () {
        return this.option.height
      },
      _pixelRatio () {
        return this.option.pixelRatio
      }
    },
    methods: {
      touchstart ($event) {
        this._wecropper.touchStart($event.mp)
            src ? resolve(src) : reject()
          })
        })
      }
    },
    mounted () {
      _wecropper = new WeCropper(Object.assign(this.option, {
        id: this._canvasId
      }))
        .on('ready', (...args) => {
          this.$emit('ready', ...args)
        })
        this._wecropper.updateCanvas()
      },
      getCropperBase64 (fn) {
        return this._wecropper.getCropperBase64(fn)
      },
      getCropperImage (opt, fn) {
        return this._wecropper.getCropperImage(opt, fn)
          this.$emit('beforeDraw', ...args)
        })
        .updateCanvas()
    }
  }
</script>
        .on('imageLoad', (...args) => {
          this.$emit('imageLoad', ...args)
        })
        .on('beforeDraw', (...args) => {
          this.$emit('beforeDraw', ...args)
        })
      }
    },
    onLoad () {
      if (!this.option) {
        return console.warn('[mpvue-cropper] 请传入option参数\n参数配置见文档：https://we-plugin.github.io/we-cropper/#/api')
      }
      this.init()
    }
  }
</script>
<MSG> fix(mpvue-cropper): lifecycle error

<DFF> @@ -62,12 +62,11 @@
             src ? resolve(src) : reject()
           })
         })
-      }
-    },
-    mounted () {
-      _wecropper = new WeCropper(Object.assign(this.option, {
-        id: this._canvasId
-      }))
+      },
+      init () {
+        _wecropper = new WeCropper(Object.assign(this.option, {
+          id: this._canvasId
+        }))
         .on('ready', (...args) => {
           this.$emit('ready', ...args)
         })
@@ -81,6 +80,13 @@
           this.$emit('beforeDraw', ...args)
         })
         .updateCanvas()
+      }
+    },
+    onLoad () {
+      if (!this.option) {
+        return console.warn('[mpvue-cropper] 请传入option参数\n参数配置见文档：https://we-plugin.github.io/we-cropper/#/api')
+      }
+      this.init()
     }
   }
 </script>
\ No newline at end of file

fix(mpvue-cropper): lifecycle error