|
父组件
- <view class="page">
- <safe-area></safe-area>
- <test-com :string='title' v-bind:list='data'></test-com>
- </view>
复制代码
子组件
- <template>
- <view class="page">
- <text>{{list}}</text>
- </view>
- </template>
- <script>
- export default {
- name: 'test-com',
- props:{
- list:Array,
- string:String
- },
- apiready(){//like created
- console.log(JSON.stringify(this.props.list));
- },
- updated (){
- console.log(JSON.stringify(this.props.list));
- },
- data() {
- return{
- arr:this.props.list,
- title:this.props.string
- }
- },
- methods: {
- }
- }
- </script>
- <style>
- .page {
- height: 100%;
- }
- </style>
复制代码
这样根本显示不了数据
我用vue 验证了一下 在vue中是可以的 但是在avm里边子组件获取不到props传递过来的数据 |
|