cropImage.vue 799 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="content" >
  3. <limeClipper :width="options.width" :scale-ratio="2" :is-lock-width="false" :is-lock-height="false" :height="options.height" :image-url="path"
  4. @success="successFn" @cancel="cancel" />
  5. </view>
  6. </template>
  7. <script>
  8. import limeClipper from './limeClipper/limeClipper.vue';
  9. export default {
  10. components: {limeClipper},
  11. data() {return {path: '',options:{"width":600,"height":600}}},
  12. onLoad({path,options}) {
  13. this.path = path
  14. //('path-path-path-path',path);
  15. if(options){
  16. this.options = JSON.parse(options)
  17. }
  18. },
  19. methods:{
  20. successFn(e){
  21. this.getOpenerEventChannel().emit('success',e.url)
  22. uni.navigateBack()
  23. },
  24. cancel(){
  25. uni.navigateBack()
  26. }
  27. }
  28. }
  29. </script>
  30. <style>
  31. .box{
  32. width: 400rpx;
  33. }
  34. .mt{
  35. margin-top: -10px;
  36. }
  37. </style>