如何在NUXTJ中的静态文件夹下获取所有文件名?
我在nuxtjs有一个前端。我想列出存储在静态文件夹下的所有PDF,并在浏览器中以单独的窗口打开这些文档,并创建一个动态链接。 因此,我想获取特定文件夹的所有文件的列表。
I have a frontend in NuxtJs. I want to list out all the PDFS stored under the static folder and make a dynamic link to open those documents in the browser as a separate window.
So I want to get the list of all the files of specific folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
nuxt.config.js
使用FS模块作为默认加载程序。我们可以将此代码段添加到
nuxt.config.js
文件中,并将响应存储到Env变量中,以便可以在任何地方使用。Nuxt.config.js
uses fs module as default loader.we can add this snippet of code to the
Nuxt.config.js
file and store the response to the env variable so that it can be used anywhere.