LoginSignup
0
1

More than 3 years have passed since last update.

「Vue.js&Nuxt.js超入門」コード修正

Posted at

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に修正!
                )
            ]);
        }
    })
0
1
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
0
1