2017-12-25 24 views
-1

私はVue js 2で自分のポートフォリオを構築してライブを終えました。 私は3つのビューを持っています。ホームビューをリロードすると大丈夫ですが、他の2つのビューではい​​くつかのエラーメッセージが表示されます。Vue JSで動作しないリロードルート

Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. 
Work:30 A parser-blocking, cross site (i.e. different eTLD+1) script, 
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://website.com' is therefore not allowed access. The response had HTTP status code 403. 

シングルページのWebアプリケーションアーキテクチャを使用するのは初めてのことです。 これを修正するための任意のアイデアですか?ここで

は、Vueのルータのウェブサイト上 example configurationsを見てみましょルータファイル

import Vue from 'vue' 
import VueRouter from 'vue-router' 
import Home from '@/views/Home' 
import Work from '@/views/Work' 
import About from '@/views/About' 

Vue.use(VueRouter) 

export default new VueRouter({ 
    mode: 'history', 
    routes: [ 
    { path: '/', component: Home }, 
    { path: '/Work', component: Work }, 
    { path: '/About', component: About } 
    ] 
}) 
+0

いくつかのコードは役に立ちます:) – webnoob

+0

確かに@webnoobですが、どこから問題が出るのか分かりません...私はルータコードを掲示し、何か他のものを見たい場合は躊躇しないでください。 :)また、Devモードでは問題ありません。 – BeeLee

+1

[Example Configurations](https://router.vuejs.org/ja/essentials/history-mode.html)の手順に従っていますか? – webnoob

答えて

1

です。彼らはしばしば、すべてが開発されているときにサーバー側で発生する問題を修正します。

+0

@BeeLee vue-cliはクライアント側のコードだけを設定します。サーバーの設定はまだ別に行う必要があります。 –

関連する問題