「Javascript/vue/helloworld」の版間の差分
提供: 初心者エンジニアの簡易メモ
| 行1: | 行1: | ||
| + | ## vueのscriptロード | ||
| + | 本番用 | ||
| + | <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script> | ||
| + | デバッグ用 | ||
| + | <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.min.js"></script> | ||
| + | |||
| + | ## サンプル | ||
helloworld.html | helloworld.html | ||
<pre> | <pre> | ||
2018年4月13日 (金) 17:33時点における版
- vueのscriptロード
本番用
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
デバッグ用
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.min.js"></script>
- サンプル
helloworld.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/vue@2.4.4/dist/vue.min.js"></script>
</head>
<body>
<div id="column1">
<p>{{text}}</p>
<p><span v-text="text"></span></p>
</div>
<script src="helloworld.js"></script>
</body>
</html>
helloworld.js
new Vue({
el: '#column1',
data: {
text: 'ほげほげ'
}
});
