File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export default {
1414 uploadMsg: String ,
1515 maxError: String ,
1616 fileError: String ,
17+ clearAll: String ,
1718 },
1819 methods: {
1920 dragOver () {
@@ -90,6 +91,12 @@ export default {
9091 this .Imgs = values;
9192 });
9293 },
94+ reset () {
95+ this .$refs .uploadInput .value = null ;
96+ this .Imgs = [];
97+ this .files = [];
98+ this .$emit (" change" , this .files );
99+ },
93100 },
94101};
95102 </script >
@@ -220,6 +227,9 @@ export default {
220227 </p >
221228 </div >
222229 <div class =" imgsPreview" v-show =" Imgs.length > 0" >
230+ <button class =" clearButton" @click =" reset" >
231+ {{ clearAll ? clearAll : "clear All" }}
232+ </button >
223233 <div class =" imageHolder" v-for =" (img, i) in Imgs" :key =" i" >
224234 <img :src =" img" />
225235 <span class =" delete" style =" color : white " @click =" deleteImg(--i)" >
@@ -340,4 +350,13 @@ export default {
340350.plus :hover {
341351 cursor : pointer ;
342352}
353+ .clearButton {
354+ color : #2d3748 ;
355+ position : absolute ;
356+ top : 7px ;
357+ right : 7px ;
358+ background : none ;
359+ border : none ;
360+ cursor : pointer ;
361+ }
343362 </style >
You can’t perform that action at this time.
0 commit comments