previewVisible.vue 778 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div>
  3. <a-modal :closable="false" class="previewImg" width="50%" :visible="previewVisible" :footer="null" @cancel="handleCancel">
  4. <img alt="example" style="width: 100%;margin-top: -1vw;" :src="'/api/api-system/system/core/sysFile/previewFile?fileId='+imgStr"/>
  5. </a-modal>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. props: {
  11. },
  12. data() {
  13. return {
  14. previewVisible: false,
  15. imgStr: ''
  16. }
  17. },
  18. mounted() {
  19. },
  20. methods: {
  21. //打开大图
  22. openBig(data){
  23. this.imgStr=data
  24. this.previewVisible = true
  25. },
  26. //关闭大图
  27. handleCancel(){
  28. this.previewVisible = false
  29. },
  30. }
  31. }
  32. </script>
  33. <style scoped>
  34. .previewImg /deep/.ant-modal-content{
  35. background: none;
  36. box-shadow: none;
  37. }
  38. </style>