vue.js - 模块解析失败:意外字符 '' (1:2) 您可能需要适当的加载程序来处理此文件类型
问题描述
我试图将 .xlsx 文件粘贴到assets/files/
vue 中,然后出现此错误
warning in ./src/assets/files/example-format.xlsx
Module parse failed: Unexpected character '' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
@ ./src/assets sync ^\.\/.*$
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.131:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
我该如何解决?太感谢了
解决方案
将 .xlsx 文件放入public
目录中,然后<a href="/demo.xlsx">Download</a>
,如果您只想让其他人下载它
推荐阅读
- c - 同时从两个csv文件读取到struct
- powerbi - 查找重叠的日期范围并添加相应的性能指标来衡量效率
- java - 切换到 Maven 3.6.3 后应用程序无法编译
- parsing - Scala:Apache DefaultParser 无法解析包含“=”的 arg
- sql - BigQuery - 获取每个组的聚合结果,即使其中一些组没有任何成员
- r - 是否可以在 `lexicon` 包的字典中添加术语?
- javascript - 有没有办法使用 JavaScript 重新定位 DOM 元素?
- c - 使用数组联合初始化结构
- python - 用于刷新页面的 Dash 应用程序 Python 按钮
- c++ - 要求一个指针同时有两个基类