GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-vue.js
/
sample1
Browse code
サンプル追加
master
1 parent
c942adc
commit
53293736938599913f50fdd92b5180a49b6c62b6
yhornisse
authored
on 26 Dec 2019
Patch
Showing
1 changed file
hello2.html
Ignore Space
Show notes
View
hello2.html
0 → 100644
<html> <head> <title>コンポーネント</title> <script src="https://cdn.jsdelivr.net/npm/vue"></script> <script> window.onload = function(){ Vue.component('hoge', { template:'<div>{{name}}: {{msg}}</div>', props: ['msg'], data: function(){// コンポーネントのdataは関数でなければダメ return { name: 'Taro' } } }); var app = new Vue({ el: '#app' }); } </script> </head> <body> <h1>サンプル</h1> <div id="app"> <hoge msg="hello"></hoge> <hoge msg="hogehoge"></hoge> <hoge msg="fuga"></hoge> </div> </body> </html>
Show line notes below