![](/img/trans.png)
[英]Vue-Cli - How to load external files (out of root) in index.html
[英]Error when trying to load external js file in index.html (Vue)
所以當我嘗試在index.html中加載外部js文件時出現以下錯誤
未捕獲到的SyntaxError:意外令牌<
我這樣稱呼它:
<script async src="/src/assets/fabric.min.js"></script>
我不確定為什么會出現此錯誤,因為如果我使用cdnjs,它會正常工作:
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.22/fabric.min.js"></script>
如有必要,我可以提供更多詳細信息。
通過將所需文件移動到static
文件夾來解決此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.