首页 > v-repeat是什么 为什么不对呢

v-repeat是什么 为什么不对呢

        <ul id='demo1'>
            <li v-repeat='items' class="item-{{$index}}">
                {{$index}} - {{parentMsg}} - {{childMsg}}
            </li>
        </ul>
        var demo1 = new Vue({
            el:'#demo1',
            data: {
                parentMsg : 'parent',
                items : [
                    { childMsg : 'this is one'},
                    { childMsg : 'this is two'}
                ]
            }
        })

这是老api,现在叫v-for,我猜你是用了新版的vue,然后看着老版的文档。

【热门文章】
【热门文章】