data(){ ?return{ ? ?selecttype:this.selectedType, ? ?onlycontent:this.onlyContent ? ?//這里一定要寫這個不然報錯, 子集向父級傳東西的時候1、用創建點擊事件等在里面$emit傳值和綁定的值名 同時props里面定義的值不能直接更改,要在data里面再創建一個中間值等于props里面的值 ---2、父級@值名='方法' 將子集的值傳給父級定義的值 ?}},在子組件中寫定義這個不報錯,但是不能賦值給父級,由于貼代碼的時候有問題,所以這里沒有貼代碼,大家知道答案麻煩幫忙回答一下呢,謝謝,是方法位置不對嗎?我把子組件傳遞參數的方法寫methods里面的,父組件也是這是報錯信息: 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: "seller"?(found in <Seller> at E:\workfiles\vue\my-project\src\components\seller\seller.vue)
添加回答
舉報
0/150
提交
取消