Javascript/vue/helloworld
提供: 初心者エンジニアの簡易メモ
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>{{text1}}</p>
<p><span v-text="text1"></span></p>
</div>
<script src="helloworld.js?1234"></script>
</body>
</html>
{{text1}} or <span v-text="text1"></span> で表示する
helloworld.js
new Vue({
el: '#column1',
data: {
text1: 'ほげほげ'
}
});
