0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vue.js関連のメモ

Last updated at Posted at 2021-12-24

この記事は、Vue.jsに関する全くの個人用メモとして残すものです。随時追記!

1. Vue-cliでプレジェクトを作るときのメモ

☞ まだインストールしていなかったら。。。

npm install -g vue-cli

プロジェクトを作るとき。xxxは自分のプロジェクト名。

vue init webpack xxx

自分のプロジェクトに移動した後に、

npm run dev

2. Vue-cliでトップ画面を設定するときのメモ

\src\router\index.jsファイルの、『import HelloWorld from '@/components/HelloWorld'』となっているところを変更する。同様に以下のHelloWorld部分も変更する。

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    }
  ]
})

3. styleについて

・ <style scoped>は、ファイル内の要素にだけスタイルが適用される。
・ src/App.vue内のスタイルは、プロジェクト内全てのファイルに適用される。

4. Vue.cliでさくらのレンタルサーバにアップするときの注意点メモ

npm run buildで作成されたdistフォルダの中身を、ルートフォルダではなくて、別のフォルダをルートとしてアップロードした時には、config/index.jsファイルの、「build」の設定項目内、assetsPublicPathの値を、『/』 から 『./ 』 に変える。
詳しいことは以下のサイトを参照。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?