仅作为记录,大佬请跳过。
转载:感谢大佬博主文章传送门
1、在vs code中,只需建立一个.html文件a.html
2、a.html代码:
<html>
<body>
<input id=b type=file webkitdirectory>
<script type="text/javascript" charset="UTF-8">
document.querySelector('#b').addEventListener('change', e => {
for (let entry of e.target.files)
console.log(entry.name, entry.webkitRelativePath);
});
</script>
</body>
</html>
3、运行
vs code中使用alt和b
运行即可: