Vue.js&Nuxt.js超入門を読み進める中で、原本のコードだと上手くいかないところがあったので、修正したところを記載していきます。(気づいたら随時更新していきます。)
p.93 「リスト2-10」
original.html
<script>
var app = new Vue ({
el: '#app',
data: data,
render: (h)=>{
return h("div", [
h("p",
{style:'font-size:20pt;'},
data.message),
h("ol",
data.items.map(i=> v('li',i))//v is not defined!
)
]);
}
})
revision.html
<script>
var app = new Vue ({
el: '#app',
data: data,
render: (h)=>{
return h("div", [
h("p",
{style:'font-size:20pt;'},
data.message),
h("ol",
data.items.map(i=> h('li',i))//vをhに修正!
)
]);
}
})