Skip to content

Commit b313438

Browse files
committed
修复vue3版本base64图片可能不显示的问题
1 parent e3aa1eb commit b313438

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Vol.Vue3版本/src/components/basic/VolTable.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,13 @@ export default defineComponent({
797797
if (column.formatter) {
798798
return column.formatter(pathSring);
799799
}
800-
let filePath = pathSring.replace(/\\/g, '/').split(',');
800+
let filePath;
801+
if (column.base64&&pathSring.indexOf('data')!=-1) {
802+
filePath=(','+pathSring).split(',data').filter(x=>{return x}).map(m=>{return 'data'+m});
803+
}else{
804+
filePath= pathSring.replace(/\\/g, '/').split(',');
805+
}
806+
801807
let fileInfo = [];
802808
for (let index = 0; index < filePath.length; index++) {
803809
let file = filePath[index];
@@ -806,7 +812,7 @@ export default defineComponent({
806812
fileInfo.push({
807813
name: '',
808814
path:
809-
(file.indexOf('base64,') == -1 ? 'data:image/png;base64,' : '') +
815+
(file.indexOf('data') == -1 ? 'data:image/png;base64,' : '') +
810816
file
811817
});
812818
} else if (file.indexOf('.') != -1) {

开发版dev/Vue.NetCore/Vol.Vue3版本/src/components/basic/VolTable.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,13 @@ export default defineComponent({
797797
if (column.formatter) {
798798
return column.formatter(pathSring);
799799
}
800-
let filePath = pathSring.replace(/\\/g, '/').split(',');
800+
let filePath;
801+
if (column.base64&&pathSring.indexOf('data')!=-1) {
802+
filePath=(','+pathSring).split(',data').filter(x=>{return x}).map(m=>{return 'data'+m});
803+
}else{
804+
filePath= pathSring.replace(/\\/g, '/').split(',');
805+
}
806+
801807
let fileInfo = [];
802808
for (let index = 0; index < filePath.length; index++) {
803809
let file = filePath[index];
@@ -806,7 +812,7 @@ export default defineComponent({
806812
fileInfo.push({
807813
name: '',
808814
path:
809-
(file.indexOf('base64,') == -1 ? 'data:image/png;base64,' : '') +
815+
(file.indexOf('data') == -1 ? 'data:image/png;base64,' : '') +
810816
file
811817
});
812818
} else if (file.indexOf('.') != -1) {

0 commit comments

Comments
 (0)