vue.js - v-repeat是什么 为什么不对呢

查看:102
本文介绍了vue.js - 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'}
                ]
            }
        })

  • parent -

          为什么是这样

解决方案

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

这篇关于vue.js - v-repeat是什么 为什么不对呢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆