Created
August 11, 2020 12:56
-
-
Save PKTseng/35ded6488a19f4fcb1883e355081a9e5 to your computer and use it in GitHub Desktop.
圖片上傳
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<input type="file" @change="selectFile"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el:"#app", | |
methods:{ | |
selectFile(e){ | |
const file = e.target.files.item(0); | |
console.log(file); | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment