鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ 求助:為什么我的子組件的props值變成了undefined?

求助:為什么我的子組件的props值變成了undefined?

父組件代碼

<template>
  <scroll class="listview"
          ref="list" 
          :listen-scroll="listenScroll"
          :probe-type="probeType">
     <div>
         ···
     </div>
  </scroll>
</template>

<script>
import Scroll from 'base/scroll/scroll'
export default {
  created(){
    this.listenScroll = true,
    this.probeType=3
  },
  components:{
    Scroll
  }
}
</script>

子組件代碼

<template>
  <div ref="wrapper">
    <slot></slot>
  </div>
</template>

<script type="text/ecmascript-6">
import BScroll from 'better-scroll'

export default {
  porps:{
    probeType:{
      type:Number,
      default:1
    },
    click:{
      type:Boolean,
      default:true
    },
    data:{
      type:Array,
      default:null
    },
    listenScroll:{
      type:Boolean,
      default:false
    }
  },
  mounted(){
    setTimeout(()=>{
      this._initScroll()
    },20) 
  },
  methods:{
    _initScroll(){
      if(!this.$refs.wrapper){
        return
      }
      this.scroll = new BScroll(this.$refs.wrapper,{
        probeType:this.probeType,
        click:this.click
      })
      console.log(this.scroll) 
      console.log(this.listenScroll,'listenScroll')
      //下文有console出來的結(jié)果
    }
  }
}

控制臺console出來的結(jié)果是:

clipboard.png

clipboard.png

麻煩各位大佬幫忙看看,是不是時機的問題?

因為父組件再怎么不把值傳給子組件,子組件的props是有default的,不應(yīng)該是undefined啊...

如果要改的話怎么改比較好? 先謝過啦!~~

回答
編輯回答
情已空

porps寫錯了,應(yīng)該是props

2017年12月4日 21:02
編輯回答
情皺

porps單詞錯了 props

2018年3月20日 21:41
編輯回答
葬愛

prop:[] 最外面不是應(yīng)該是中括號嗎

2018年1月16日 01:18
編輯回答
菊外人

打錯字了,props

2017年12月25日 13:34
編輯回答
焚音
export default {
  porps:{

porps!?

2018年8月20日 14:10