我的微信小程序的项目结构如下。
+ libs
+ pages
+ index
- index.js
- index.wxml
+ res
- foo.json
- bar.json
- app.js
- app.json
- app.wxss
- sitemap.json
在index.js
中,我需要获取/res
的文件列表,类似['foo.json', 'bar.json']
。
在onReday()
的{{1}}功能中,如何获取index.js
目录的文件列表?