Created
August 11, 2020 12:54
-
-
Save PKTseng/8e07aa29d9a6b5fc089c74e80e379b68 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", | |
data:{ | |
}, | |
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