vue2.0 组件渲染列表。请问我这样写为什么不可以?正确的写法是?

html:


        <div id="app">

            <branch-list :datas="gridData"></branch-list>

        </div>

        <template id="branchList">

            <ul>

                <li class="branch" v-for="grid in datas" style="background:#f3f4f9;margin-bottom:0px;">

                    <!-- <div v-for="col in columns"> -->

                        <a href="javascript:void(0)"><img src="{{grid.Thumbnail}}" height="75" width="80" style="margin-right:5px"></a>    

                </li>

            </ul>

        </template>

js:


"use strict";    

    Vue.component('branch-list', {

        template: '#branchList',

        props: ['datas'],    

    })

    new Vue({

        el:"#app",        

        data:{

            gridColumns: ['Thumbnail'],            

            gridData: [{"Thumbnail":"images/1.png"}],            

        },                            

    })

结果是:

https://img1.mukewang.com/5c3305d900014f3503700160.jpg

vue.js初学者,望大神指教。

暮色呼如
浏览 442回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript