vueuse使用(VUE3)
vue create my-vue
HelloWorld.vue
<template> <button type="button" @click="open">选择文件</button> </template> <script> import { useFileDialog } from '@vueuse/core' export default { name: 'HelloWorld', props: { msg: String }, setup(){ const { files, open, reset } = useFileDialog() return {files, open, reset} } } </script>