File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 250
250
@input =" onChangeInput"
251
251
@keydown.esc =" escapeTextarea"
252
252
@keydown.enter.exact.prevent =" "
253
+ @paste =" pasteImage"
253
254
/>
254
255
255
256
<div class =" vac-icon-textarea" >
@@ -943,6 +944,25 @@ export default {
943
944
this .$refs .file .value = ' '
944
945
this .$refs .file .click ()
945
946
},
947
+ pasteImage (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])
964
+ }
965
+ },
946
966
async onFileChange (files ) {
947
967
this .fileDialog = true
948
968
this .resetMediaFile ()
You can’t perform that action at this time.
0 commit comments