LoginSignup
1
0

More than 1 year has passed since last update.

Vue.js のサンプル (Hello World)

Last updated at Posted at 2018-08-16

Vue.js v3 の簡単なサンプルです。

index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" />
<script src="https://unpkg.com/vue@3.2.33"></script>
<title>vue.js ex01</title>
</head>
<body>
<h2>ex01</h2><p />
<div id="app">{{ message }}</div>
<div id="app2">{{ message }}</div>
<div id="app3">{{ message }}</div>
<script src="ex01.js"></script>
<p />
Aug/16/2018 AM 08:25<p />
</body>
</html>
ex01.js
// ---------------------------------------------------------------
//	ex01.js
//
//						May/09/2022
//
// ---------------------------------------------------------------
const app = { data() { return { message: '皆さん、こんにちは。' } } }
Vue.createApp(app).mount('#app')


const app2 = { data() { return { message: 'Hello World!' } } }
Vue.createApp(app2).mount('#app2')

const app3 = { data() { return { message: 'Good Morning!' } } }
Vue.createApp(app3).mount('#app3')

// ---------------------------------------------------------------

実行結果
vue_aug1601.png

次のバージョンで確認しました。

Vue.js v3.2.33

Vue.js の最新バージョンはこちらで確認できます。

vuejs/core

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