封装iview i-table,传入属性不生效

new Vue({
    el: '#app',
    data:{
        c: [{title: 'Name',key: 'name'},{title: 'Age',key: 'age'},{title: 'Address',key: 'address'}],
        d: [
        {
            name: 'John Brown',
            age: 18,
            address: 'New York No. 1 Lake Park',
            date: '2016-10-03'
        },
        ],
    },
})  

Vue.component(
    'test1', 
    {
        template:'<div><Table :columns="c" :data="d"></Table></div>',
        props: ['c','d'],
    }
)
</script>
<div id="app">
<test1 :c="c" :d="d"></test1>
<div><i-Table :columns="c" :data="d"></i-Table></div>
</div>

其中test1不生效。

阅读 1.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题