正则处理文件名称

This commit is contained in:
faiz 2024-07-31 10:51:17 +08:00
parent 58f53970a7
commit 3ae9e1b1d2
1 changed files with 10 additions and 4 deletions

View File

@ -184,7 +184,7 @@
class="avatar"
alt=""
/>
<div class="desc">{{ item }}</div>
<div class="desc">{{ handleRegex(item) }}</div>
</div>
<i class="el-icon-plus avatar-uploader-icon" />
</el-upload>
@ -210,7 +210,7 @@
class="avatar"
alt=""
/>
<div class="desc">{{ item }}</div>
<div class="desc">{{ handleRegex(item) }}</div>
</div>
<i class="el-icon-plus avatar-uploader-icon" />
</el-upload>
@ -316,7 +316,7 @@
class="avatar"
alt=""
/>
<div class="desc">{{ item }}</div>
<div class="desc">{{ handleRegex(item) }}</div>
</div>
<i class="el-icon-plus avatar-uploader-icon" />
</el-upload>
@ -342,7 +342,7 @@
class="avatar"
alt=""
/>
<div class="desc">{{ item }}</div>
<div class="desc">{{ handleRegex(item) }}</div>
</div>
<i class="el-icon-plus avatar-uploader-icon" />
</el-upload>
@ -475,6 +475,12 @@ export default {
);
console.log("====111122222===" + this.anchors.trip_zip);
},
handleRegex(val) {
const regex = /\/([^\/]+)$/;
const match = val.match(regex);
console.log(match[1]);
return match[1];
},
onAdd() {
this.anchors.qaQuestions = [
{