[英]Vue.js issue with routes
我在Vuejs上有單頁應用程序,主頁在localhost /上。 我要制作管理面板。 我創建了新的組件Bots並為其路由“ localhost / panel / bots”。 當我打開此頁面時,我收到一個錯誤
http://localhost/panel/index.js
因為我在應用程序上有鏈接
<script type="text/javascript" src="index.js"></script>
在我的主模板中
如何解決這個問題? 謝謝!
改成
<script type="text/javascript" src="/index.js"></script>
這將使您的瀏覽器從root /
目錄而不是/panel
加載index.js
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.