问题:
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目录中的资源路径。
所有评论(0)