File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -944,23 +944,16 @@ export default {
944
944
this .$refs .file .value = ' '
945
945
this .$refs .file .click ()
946
946
},
947
- onPasteImage (pasteEvent , callback ) {
948
- if (pasteEvent .clipboardData === false ) {
949
- if (typeof (callback) === ' function' ) {
950
- callback (undefined )
951
- }
952
- }
953
- this .clipboardData = pasteEvent .clipboardData .items
954
- var items = pasteEvent .clipboardData .items
955
- if (items === undefined ) {
956
- if (typeof (callback) === ' function' ) {
957
- callback (undefined )
958
- }
959
- }
960
- for (var i = 0 ; i < items .length ; i++ ) {
961
- if (items[i].type .indexOf (' image' ) === - 1 ) continue
962
- var blob = items[i].getAsFile ()
963
- this .onFileChange ([blob])
947
+ onPasteImage (pasteEvent ) {
948
+ const items = pasteEvent .clipboardData ? .items
949
+
950
+ if (items) {
951
+ items .forEach (item => {
952
+ if (item .type .indexOf (' image' ) !== - 1 ) {
953
+ const blob = item .getAsFile ()
954
+ this .onFileChange ([blob])
955
+ }
956
+ })
964
957
}
965
958
},
966
959
async onFileChange (files ) {
You can’t perform that action at this time.
0 commit comments