Commit e266b5f2 by 前端

修复照片命名规则

1 parent dbf1d3d3
......@@ -68,14 +68,18 @@ export default {
readStatus: "",
acceptFile: ".jpg,.png",
previewList: [],
nameIndex:0
};
},
watch: {
value: {
handler: function (n, o) {
this.imgList = n;
if(!this.nameIndex){
this.nameIndex = n.length;
}
console.log('666666666')
},
immediate: true,
},
status: {
handler: function (n, o) {
......@@ -84,7 +88,8 @@ export default {
immediate: true,
},
},
mounted() {},
mounted() {
},
methods: {
// 监听选择图片
onChange(file, fileList) {
......@@ -145,8 +150,9 @@ export default {
console.log(res);
let response = res.data;
if (response.returnCode == 0) {
_this.imgList.push({ path: response.data, name: `照片${_this.imgList.length+1}` });
_this.imgList.push({ path: response.data, name: `照片${_this.nameIndex+1}` });
_this.previewList.push(res.data);
_this.nameIndex +=1;
console.log(_this.imgList);
//
//this.$emit("change", response.data);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!