mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-11-04 16:17:40 +08:00 
			
		
		
		
	v3.8.4:修复图片预览组件src属性为null值控制台报错问题(I5KBAS)
This commit is contained in:
		@ -19,7 +19,7 @@ export default {
 | 
				
			|||||||
  props: {
 | 
					  props: {
 | 
				
			||||||
    src: {
 | 
					    src: {
 | 
				
			||||||
      type: String,
 | 
					      type: String,
 | 
				
			||||||
      required: true
 | 
					      default: ""
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    width: {
 | 
					    width: {
 | 
				
			||||||
      type: [Number, String],
 | 
					      type: [Number, String],
 | 
				
			||||||
@ -32,6 +32,9 @@ export default {
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  computed: {
 | 
					  computed: {
 | 
				
			||||||
    realSrc() {
 | 
					    realSrc() {
 | 
				
			||||||
 | 
					      if (!this.src) {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      let real_src = this.src.split(",")[0];
 | 
					      let real_src = this.src.split(",")[0];
 | 
				
			||||||
      if (isExternal(real_src)) {
 | 
					      if (isExternal(real_src)) {
 | 
				
			||||||
        return real_src;
 | 
					        return real_src;
 | 
				
			||||||
@ -39,6 +42,9 @@ export default {
 | 
				
			|||||||
      return process.env.VUE_APP_BASE_API + real_src;
 | 
					      return process.env.VUE_APP_BASE_API + real_src;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    realSrcList() {
 | 
					    realSrcList() {
 | 
				
			||||||
 | 
					      if (!this.src) {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      let real_src_list = this.src.split(",");
 | 
					      let real_src_list = this.src.split(",");
 | 
				
			||||||
      let srcList = [];
 | 
					      let srcList = [];
 | 
				
			||||||
      real_src_list.forEach(item => {
 | 
					      real_src_list.forEach(item => {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user