umbrella22

修正错误

1 <template> 1 <template>
2 <div class="upload-container"> 2 <div class="upload-container">
3 <el-button 3 <el-button
4 - :style="{background:color,borderColor:color}" 4 + :style="{ background: color, borderColor: color }"
5 icon="el-icon-upload" 5 icon="el-icon-upload"
6 size="mini" 6 size="mini"
7 type="primary" 7 type="primary"
8 - @click=" dialogVisible=true" 8 + @click="dialogVisible = true"
9 - >上传图片</el-button> 9 + >上传图片</el-button
10 + >
10 <el-dialog :visible.sync="dialogVisible"> 11 <el-dialog :visible.sync="dialogVisible">
11 <el-upload 12 <el-upload
12 ref="upload" 13 ref="upload"
...@@ -31,32 +32,30 @@ ...@@ -31,32 +32,30 @@
31 </template> 32 </template>
32 33
33 <script> 34 <script>
34 -
35 -
36 export default { 35 export default {
37 name: "EditorSlideUpload", 36 name: "EditorSlideUpload",
38 props: { 37 props: {
39 color: { 38 color: {
40 type: String, 39 type: String,
41 - default: "#1890ff" 40 + default: "#1890ff",
42 - } 41 + },
43 }, 42 },
44 data() { 43 data() {
45 return { 44 return {
46 dialogVisible: false, 45 dialogVisible: false,
47 listObj: {}, 46 listObj: {},
48 fileList: [], 47 fileList: [],
49 - picPostData: {} 48 + picPostData: {},
50 }; 49 };
51 }, 50 },
52 methods: { 51 methods: {
53 checkAllSuccess() { 52 checkAllSuccess() {
54 return Object.keys(this.listObj).every( 53 return Object.keys(this.listObj).every(
55 - item => this.listObj[item].hasSuccess 54 + (item) => this.listObj[item].hasSuccess
56 ); 55 );
57 }, 56 },
58 handleSubmit() { 57 handleSubmit() {
59 - const arr = Object.keys(this.listObj).map(v => this.listObj[v]); 58 + const arr = Object.keys(this.listObj).map((v) => this.listObj[v]);
60 console.log(arr); 59 console.log(arr);
61 if (!this.checkAllSuccess()) { 60 if (!this.checkAllSuccess()) {
62 this.$message( 61 this.$message(
...@@ -92,10 +91,14 @@ export default { ...@@ -92,10 +91,14 @@ export default {
92 } 91 }
93 } 92 }
94 }, 93 },
95 - handleError(err){ 94 + handleError(err) {
96 - this.alert(err) 95 + console.log(err);
97 - } 96 + this.$alert(err, "发生错误", {
98 - } 97 + confirmButtonText: "确定",
98 + callback: (action) => {},
99 + });
100 + },
101 + },
99 }; 102 };
100 </script> 103 </script>
101 104
......