Home  >  Q&A  >  body text

javascript - How to upload images to vue on the mobile phone

is an input. After clicking it, you can open the gallery and select the picture I want. After that, I can get the picture address he selected and pass the data to the interface. I can write it myself, but I don’t know how to accept the picture address he selected. I hope God can tell me how to write

<template>
 <input accept="image/*" type="file" >、
</template>

 export default {
    data{
        retrun{
        }
    },
    mounted{
    
    },
    
    methods{
    //在这里获取到上传的图片就可以
    }
}
PHP中文网PHP中文网2662 days ago3397

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-07-05 11:03:18

    Can you write native JS?

    reply
    0
  • typecho

    typecho2017-07-05 11:03:18

    Use Baidu’s plug-in webuploader

    reply
    1
  • 世界只因有你

    世界只因有你2017-07-05 11:03:18

    https://github.com/ElemeFE/el...

    reply
    0
  • Cancelreply