Commit 7cce9705 by 前端

修复命名规则

1 parent e266b5f2
......@@ -21,6 +21,7 @@
v-model="otherList"
:limit="limit"
:status="status"
:nameIndex="otherList.length"
@change="onChange('otherList')"
></ImageOtherUpload>
</div>
......
......@@ -60,6 +60,10 @@ export default {
type: [String, Number],
default: 20,
},
nameIndex: {
type: Number,
default: 0,
},
},
data() {
return {
......@@ -68,17 +72,16 @@ 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')
// if(!this.nameIndex){
// this.nameIndex = n.length;
// }
// console.log('666666666')
},
},
status: {
......@@ -88,8 +91,7 @@ export default {
immediate: true,
},
},
mounted() {
},
mounted() {},
methods: {
// 监听选择图片
onChange(file, fileList) {
......@@ -150,9 +152,12 @@ export default {
console.log(res);
let response = res.data;
if (response.returnCode == 0) {
_this.imgList.push({ path: response.data, name: `照片${_this.nameIndex+1}` });
_this.imgList.push({
path: response.data,
name: `照片${_this.nameIndex + 1}`,
});
_this.previewList.push(res.data);
_this.nameIndex +=1;
_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!