Uncaught Error: OBJLoader: Unexpected line: "<!DOCTYPE html>"

问题:

vue-3d-model.esm.js?e678:44779 Uncaught Error: OBJLoader: Unexpected line: "<!DOCTYPE html>"
at OBJLoader.parse (vue-3d-model.esm.js?e678:44779)
at Object.eval [as onLoad] (vue-3d-model.esm.js?e678:44589)
at XMLHttpRequest.eval (vue-3d-model.esm.js?e678:30476)

解决前:

<model-obj :backgroundAlpha="0"@on-load="onLoad" src="../../assets/models/tree.obj"></model-obj>

解决后:

<model-obj :backgroundAlpha="0"@on-load="onLoad" src="../static/models/tree.obj"></model-obj>

总结:您需要将模型放在公共文件夹中(static),因为vue-cli会自动更改assets目录中的资源路径。

转载于:https://www.cnblogs.com/lijjj/p/10717148.html

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页