0
1

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 1 year has passed since last update.

②SpringBootプロジェクトにVue.jsを追加する方法 【Vue.js+SpringBootでアプリケーション作成】

Last updated at Posted at 2022-12-11

SpringBootプロジェクト作成方法

下記をご覧ください。
①SpringBootプロジェクト作成方法 【Vue.js+SpringBootでアプリケーション作成】

ディレクトリ構造

image.png

Vue.jsの追加

  1. コマンドプロンプトでSpring Bootプロジェクトの配下に移動
> cd .\twitterbot\  

Spring Boot プロジェクト外の場合、cd Spring Bootプロジェクトのパスでディレクトリを移動できます。

  1. Vue.jsを追加
> vue create web

vue create 作成したいディレクトリ名 
で作成できます。
3. Vue.js のversionを選択

Default ([Vue 3] babel, eslint)を選択します。

image.png

image.png

Vue.jsプロジェクトの追加ができました。

image.png
4. Vue.jsのビルド設定
ソースフォルダにあるpackage.jsonを編集します。
「scripts」に「build」の値に「 --dest ../src/main/resources/static」を追加。
image.png
5. Vue.jsのビルド
コマンドプロンプトの「cd」コマンドで、作成したVue.jsのソースフォルダに移動します。
「cd web」
「npm run build」コマンドでビルドします。
image.png
6. 実行
「Run」ボタンで実行します。
image.png
7. http://localhost:8080/index.html
Spring Boot起動後、
http://localhost:8080/index.html」
を開く。

image.png

SpringBootプロジェクトでVue.jsの起動ができました。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?