vue2.0 練習中報錯問題處理(數據綁定錯誤)

vue2.0 練習中報錯問題處理vue

報錯(數據是能夠正確顯示在頁面中的):code

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "selectType"

報錯說明 component

主要問題出在props的數據上,props綁定的數據是從父級傳過來的,提示中 selectType 是自身組件中的數據,不須要從父級獲取it

解決方法sed

將 selectType 綁定到 data() 上就對了select

相關文章
相關標籤/搜索